我需要针对 SOCKS 代理设置代理身份验证。我发现这篇文章给出的说明似乎适用于常见的 HTTP 代理。
httpclient.getHostConfiguration().setProxy("proxyserver.example.com", 8080);
HttpState state = new HttpState();
state.setProxyCredentials(new AuthScope("proxyserver.example.com", 8080),
new UsernamePasswordCredentials("username", "password"));
httpclient.setState(state);
这也适用于SOCKS代理,还是我必须做一些不同的事情?