我正在使用apache的常见httpclient库.是否可以通过代理发出HTTP请求?更具体地说,我需要使用代理列表来处理多线程POST请求(现在我正在使用单线程GET请求进行测试).
我试着用:
httpclient.getHostConfiguration().setProxy("67.177.104.230", 58720);
Run Code Online (Sandbox Code Playgroud)
我得到了该代码的错误:
21.03.2012. 20:49:17 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused: connect
21.03.2012. 20:49:17 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
21.03.2012. 20:49:19 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused: connect
21.03.2012. 20:49:19 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
21.03.2012. 20:49:21 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused: connect
21.03.2012. 20:49:21 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
org.apache.commons.httpclient.ProtocolException: The server xxxxx failed to respond with a …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建通过SOCKS5代理通过Apache HC 4发送HTTP请求的应用程序.我不能使用app-global代理,因为app是多线程的(我需要为每个实例使用不同的代理).我没有找到使用HC4的SOCKS5的例子.我怎么用呢?HttpClient