connect-to.md: expand with examples

- add referer from the resolve section to connect-to if user wants
  wildcard for the port number

Closes #13989
This commit is contained in:
Daniel Stenberg 2024-06-23 14:12:33 +02:00
parent d5777afac6
commit 857e334a45
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 13 additions and 0 deletions

View File

@ -28,3 +28,13 @@ original hostname and port number.
A hostname specified to this option is compared as a string, so it needs to
match the name used in request URL. It can be either numerical such as
`127.0.0.1` or the full host name such as `example.org`.
Example: redirect connects from the example.com hostname to 127.0.0.1
independently of port number:
curl --connect-to example.com::127.0.0.1: https://example.com/
Example: redirect connects from all hostnames to 127.0.0.1 independently of
port number:
curl --connect-to ::127.0.0.1: http://example.com/

View File

@ -37,6 +37,9 @@ parallel transfers with a lot of files. In such cases, if this option is used
curl tries to resolve the host as it normally would once the timeout has
expired.
To redirect connects from a specific hostname or any hostname, independently
of port number, consider the --connect-to option.
Support for providing the IP address within [brackets] was added in 7.57.0.
Support for providing multiple IP addresses per entry was added in 7.59.0.