From: Daniel Stenberg Date: Sun, 23 Jun 2024 12:12:33 +0000 (+0200) Subject: connect-to.md: expand with examples X-Git-Tag: curl-8_9_0~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=857e334a455080be3bf5d019ba07867c675d21c6;p=thirdparty%2Fcurl.git 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 --- diff --git a/docs/cmdline-opts/connect-to.md b/docs/cmdline-opts/connect-to.md index 360ef0da20..2a1ec56436 100644 --- a/docs/cmdline-opts/connect-to.md +++ b/docs/cmdline-opts/connect-to.md @@ -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/ diff --git a/docs/cmdline-opts/resolve.md b/docs/cmdline-opts/resolve.md index ca1f930fcd..58c1accbed 100644 --- a/docs/cmdline-opts/resolve.md +++ b/docs/cmdline-opts/resolve.md @@ -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.