HTTPCLIENT-1128: SystemDefaultHttpClient to use ProxySelectorRoutePlanner

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1181014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2011-10-10 15:17:08 +00:00
parent 7f04b88f12
commit 90b6853111
1 changed files with 10 additions and 0 deletions

View File

@ -27,9 +27,13 @@
package org.apache.http.impl.client;
import java.net.ProxySelector;
import org.apache.http.annotation.ThreadSafe;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.routing.HttpRoutePlanner;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
import org.apache.http.impl.conn.SchemeRegistryFactory;
import org.apache.http.params.HttpParams;
@ -89,4 +93,10 @@ public class SystemDefaultHttpClient extends DefaultHttpClient {
return new PoolingClientConnectionManager(SchemeRegistryFactory.createSystemDefault());
}
@Override
protected HttpRoutePlanner createHttpRoutePlanner() {
return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
ProxySelector.getDefault());
}
}