我需要针对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);
Run Code Online (Sandbox Code Playgroud)
这也适用于SOCKS代理,还是我必须做一些不同的事情?