]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connect-to.md: expand with examples
authorDaniel Stenberg <daniel@haxx.se>
Sun, 23 Jun 2024 12:12:33 +0000 (14:12 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 23 Jun 2024 13:52:06 +0000 (15:52 +0200)
- add referer from the resolve section to connect-to if user wants
  wildcard for the port number

Closes #13989

docs/cmdline-opts/connect-to.md
docs/cmdline-opts/resolve.md

index 360ef0da2032c0083eabcd1ed3fbd52a317389b2..2a1ec5643685a9ce9c755227c0d69f19e143d5f1 100644 (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/
index ca1f930fcd2f532886728f96b62771a36db01373..58c1accbed3c0fe011b95f46347f8b9b09f42ec6 100644 (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.