Change where curl connects without changing the URL's host name.
Section: Debugging and Diagnostics
Redirect one host:port to another
bash
bash
curl --connect-to example.com:443:staging.example.net:8443 https://example.comExplanation
Useful for staging, canaries, and origin testing.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Debugging and Diagnostics
Override DNS resolution
Map a hostname and port to a specific IP address.
Limit total transfer time
Abort the request after a fixed total duration.