mirror of
https://github.com/curl/curl.git
synced 2025-09-28 15:06:48 +03:00
socks proxy: allow socks5h:// prefix too
Using 'socks5h' as proxy protocol will make it a CURLPROXY_SOCKS5_HOSTNAME proxy which is SOCKS5 and asking the proxy to resolve host names. I found no "standard" protocol name for this.
This commit is contained in:
parent
fda0985bfd
commit
558f997e99
|
@ -634,9 +634,11 @@ specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
|
||||||
include protocol prefix (http://) and embedded user + password.
|
include protocol prefix (http://) and embedded user + password.
|
||||||
|
|
||||||
Since 7.21.7, the proxy string may be specified with a protocol:// prefix to
|
Since 7.21.7, the proxy string may be specified with a protocol:// prefix to
|
||||||
specify alternative proxy protocols. Use socks4://, socks4a:// or socks5:// to
|
specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
|
||||||
request the specific SOCKS version to be used. No protocol specified, http://
|
socks5h:// (the last one to enable socks5 and asking the proxy to do the
|
||||||
and all others will be treated as HTTP proxies.
|
resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type) to request the
|
||||||
|
specific SOCKS version to be used. No protocol specified, http:// and all
|
||||||
|
others will be treated as HTTP proxies.
|
||||||
.IP CURLOPT_PROXYPORT
|
.IP CURLOPT_PROXYPORT
|
||||||
Pass a long with this option to set the proxy port to connect to unless it is
|
Pass a long with this option to set the proxy port to connect to unless it is
|
||||||
specified in the proxy string \fICURLOPT_PROXY\fP.
|
specified in the proxy string \fICURLOPT_PROXY\fP.
|
||||||
|
|
|
@ -4069,7 +4069,9 @@ static CURLcode parse_proxy(struct SessionHandle *data,
|
||||||
endofprot = strstr(proxy, "://");
|
endofprot = strstr(proxy, "://");
|
||||||
if(endofprot) {
|
if(endofprot) {
|
||||||
proxyptr = endofprot+3;
|
proxyptr = endofprot+3;
|
||||||
if(checkprefix("socks5", proxy))
|
if(checkprefix("socks5h", proxy))
|
||||||
|
conn->proxytype = CURLPROXY_SOCKS5_HOSTNAME;
|
||||||
|
else if(checkprefix("socks5", proxy))
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user