Skip to content

Commit

Permalink
fixes bug with setting of HTTP proxy value
Browse files Browse the repository at this point in the history
in newer version of Apache HTTPClient the proxy setting was being ignored
  • Loading branch information
n8fr8 committed Jun 30, 2014
1 parent 595c1fe commit 435d9dc
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -20,6 +20,7 @@
import android.util.Log;
import ch.boye.httpclientandroidlib.HttpHost;
import ch.boye.httpclientandroidlib.conn.ClientConnectionOperator;
import ch.boye.httpclientandroidlib.conn.params.ConnRoutePNames;
import ch.boye.httpclientandroidlib.conn.scheme.PlainSocketFactory;
import ch.boye.httpclientandroidlib.conn.scheme.Scheme;
import ch.boye.httpclientandroidlib.conn.scheme.SchemeRegistry;
Expand Down Expand Up @@ -152,9 +153,9 @@ public void useProxy(boolean enableTor, String type, String host, int port)
{
this.proxyType = type;

HttpHost proxyHost = new HttpHost(host, port);
getParams().setParameter(type, proxyHost);

HttpHost proxyHost = new HttpHost(host, port, type);
getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
if (type.equalsIgnoreCase("socks"))
{
this.proxyHost = proxyHost;
Expand Down

0 comments on commit 435d9dc

Please sign in to comment.