From 90b685311151dd49141743236615f5a0c03cef9f Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 10 Oct 2011 15:17:08 +0000 Subject: [PATCH] HTTPCLIENT-1128: SystemDefaultHttpClient to use ProxySelectorRoutePlanner git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1181014 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/client/SystemDefaultHttpClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java index 5caba9294..d60053daf 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java @@ -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()); + } + }