SOCKS proxy

SOCKS is a protocol used for proxies and curl supports it. curl supports both SOCKS version 4 as well as version 5, and both versions come in two flavors.

You can select the specific SOCKS version to use by using the correct scheme part for the given proxy host with -x, or you can specify it with a separate option instead of -x.

SOCKS4 is for the version 4 but curl resolves the name:

curl -x socks4://

curl --socks4

SOCKS4a is for the version 4 with resolving done by the proxy:

curl -x socks4a://

curl --socks4a

SOCKS5 is for the version 5 and SOCKS5-hostname is for the version 5 without resolving the hostname locally:

curl -x socks5://

curl --socks5

The SOCKS5-hostname versions. This sends the hostname to the proxy so there is no name resolving done by curl locally:

curl -x socks5h://

curl --socks5-hostname

Helpful table to figure how which side that resolves the name for which socks version:

SOCKSwho resolves the nameworks with IPv6