connect-to.md (1353B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Long: connect-to 5 Arg: <HOST1:PORT1:HOST2:PORT2> 6 Help: Connect to host2 instead of host1 7 Added: 7.49.0 8 Category: connection dns 9 Multi: append 10 See-also: 11 - resolve 12 - header 13 Example: 14 - --connect-to example.com:443:example.net:8443 $URL 15 --- 16 17 # `--connect-to` 18 19 For a request intended for the `HOST1:PORT1` pair, connect to `HOST2:PORT2` 20 instead. This option is only used to establish the network connection. It does 21 NOT affect the hostname/port number that is used for TLS/SSL (e.g. SNI, 22 certificate verification) or for the application protocols. 23 24 `HOST1` and `PORT1` may be empty strings, meaning any host or any port number. 25 `HOST2` and `PORT2` may also be empty strings, meaning use the request's 26 original hostname and port number. 27 28 A hostname specified to this option is compared as a string, so it needs to 29 match the name used in the request URL. It can be either numerical such as 30 `127.0.0.1` or the full host name such as `example.org`. 31 32 Example: redirect connects from the example.com hostname to 127.0.0.1 33 independently of port number: 34 35 curl --connect-to example.com::127.0.0.1: https://example.com/ 36 37 Example: redirect connects from all hostnames to 127.0.0.1 independently of 38 port number: 39 40 curl --connect-to ::127.0.0.1: http://example.com/