Commit 775cc1be authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

parse_proxy: treat "socks://x" as a socks4 proxy

Selected socks proxy in Google's Chrome browser. Resulting in the
following environment variables:

NO_PROXY=localhost,127.0.0.0/8
ALL_PROXY=socks://localhost:1080/
all_proxy=socks://localhost:1080/
no_proxy=localhost,127.0.0.0/8

... and libcurl didn't treat 'socks://' as socks but instead picked HTTP
proxy.

Reported by: Scott Bailey

Bug: http://curl.haxx.se/bug/view.cgi?id=3566860
parent f05e5136
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4249,7 +4249,7 @@ static CURLcode parse_proxy(struct SessionHandle *data,
      conn->proxytype = CURLPROXY_SOCKS5;
      conn->proxytype = CURLPROXY_SOCKS5;
    else if(checkprefix("socks4a", proxy))
    else if(checkprefix("socks4a", proxy))
      conn->proxytype = CURLPROXY_SOCKS4A;
      conn->proxytype = CURLPROXY_SOCKS4A;
    else if(checkprefix("socks4", proxy))
    else if(checkprefix("socks4", proxy) || checkprefix("socks", proxy))
      conn->proxytype = CURLPROXY_SOCKS4;
      conn->proxytype = CURLPROXY_SOCKS4;
    /* Any other xxx:// : change to http proxy */
    /* Any other xxx:// : change to http proxy */
  }
  }