开发者

How to use URLConnection through a SOCKS proxy?

How can I set the SOCKS proxy for a URLConnection given by (new URL(url)).openConnection()?

Different proxies are needed on a per-connection basis, so please don't suggest setting sys开发者_如何学Gotem properties.


If you want to use different proxy settings on a per-connection bases, you can use the Java 6.0 ProxySelector mechanism as described in Java Networking and Proxies. Specifically, read sections 3 and 4.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜