The Proxy class can be used specify proxy details at the connection level.
SocketAddress addr = new InetSocketAddress("proxy.objects.com", 88);
Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr);
URL url = new URL("http://java.sun.com/");
URConnection conn = url.openConnection(proxy);
written by objects
\\ tags: connection, proxy, SOCKS
The Proxy class can be used specify proxy details at the connection level.
SocketAddress addr = new InetSocketAddress("proxy.objects.com", 88);
Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
URL url = new URL("http://java.sun.com/");
URConnection conn = url.openConnection(proxy);
written by objects
\\ tags: connection, http, proxy
You can use the system properties socksProxyHost and socksProxyPort to specify a SOCKS proxy to use for all connections. eg.
java -DsocksProxyHost=socks.objects.com -DsocksProxyPort=88 MyApp
written by objects
\\ tags: proxy, SOCKS
Recent Comments