File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/com/microsoft/azure/documentdb Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import java .io .IOException ;
8
8
import java .io .UnsupportedEncodingException ;
9
+ import java .net .ProxySelector ;
9
10
import java .net .URI ;
10
11
import java .net .URISyntaxException ;
11
12
import java .net .URLEncoder ;
30
31
import org .apache .http .client .methods .HttpRequestBase ;
31
32
import org .apache .http .impl .client .DefaultHttpClient ;
32
33
import org .apache .http .impl .conn .PoolingClientConnectionManager ;
34
+ import org .apache .http .impl .conn .ProxySelectorRoutePlanner ;
33
35
import org .apache .http .impl .conn .SchemeRegistryFactory ;
34
36
import org .apache .http .params .HttpConnectionParams ;
35
37
import org .apache .http .params .HttpParams ;
@@ -154,7 +156,13 @@ private HttpClient getHttpClient(boolean isForMedia) {
154
156
* @return the created HttpClient
155
157
*/
156
158
private HttpClient createHttpClient (boolean isForMedia ) {
157
- HttpClient httpClient = new DefaultHttpClient (this .connectionManager );
159
+ ProxySelectorRoutePlanner ps = new ProxySelectorRoutePlanner (
160
+ SchemeRegistryFactory .createDefault (), ProxySelector .getDefault ());
161
+
162
+ DefaultHttpClient defaultHttpClient = new DefaultHttpClient (this .connectionManager );
163
+ defaultHttpClient .setRoutePlanner (ps );
164
+
165
+ HttpClient httpClient = defaultHttpClient ;
158
166
HttpParams httpParams = httpClient .getParams ();
159
167
160
168
if (isForMedia ) {
You can’t perform that action at this time.
0 commit comments