Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usingcurl/proxies/socks.md: clarify name resolving #352

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions usingcurl/proxies/socks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ 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 and SOCKS4a is for the version 4 without resolving
the host name locally:
SOCKS4 is for the version 4 but curl resolves the name:

curl -x socks4://proxy.example.com http://www.example.com/

curl --socks4 proxy.example.com http://www.example.com/

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

curl -x socks4a://proxy.example.com http://www.example.com/

Expand All @@ -27,9 +26,19 @@ resolving the host name locally:

curl --socks5 proxy.example.com http://www.example.com/

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

curl -x socks5h://proxy.example.com http://www.example.com/

curl --socks5-hostname proxy.example.com http://www.example.com/

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

| SOCKS | who resolves the name | works with IPv6 |
|-------|-----------------------|-----------------|
| 4 | curl | no |
| 4a | proxy | no |
| 5 | curl | yes |
| 5h | proxy | yes |
Loading