I would like to use different proxies instead of just one. Currently the ProxySelector sets a system wide proxy for all URLConnections. Does anyone know of a library that supports non system-wide proxies. Just something as simple as adding the appropriate proxy http headers/socks layers?
+2
A:
You can specify a proxy when opening a URLConnection
. Is that what you mean?
If you want something that works automatically, you could implement a ProxySelector
that uses a ThreadLocal
table internally to provide different selectors based on the calling thread.
erickson
2010-02-08 20:52:20
Yes, thanks....
Zombies
2010-02-08 21:16:30
A:
Check out http://java.sun.com/javase/6/docs/api/java/net/URL.html#openConnection(java.net.Proxy)
It takes http://java.sun.com/javase/6/docs/api/java/net/Proxy.html as an argument.
jckdnk111
2010-02-08 22:09:40