Add equivalent cURL --resolve flag
See original GitHub issuePer cURL --help:
–resolve HOST:PORT:ADDRESS Force resolve of HOST:PORT to ADDRESS
(bypasses hosts file)
example usage:
http --resolve "www.foo.com:127.0.0.1" GET www.foo.com/whatever
OR
http --resolve "www.foo.com:8080:127.0.0.1" GET www.foo.com:8080/whatever
Issue Analytics
- State:
- Created 11 years ago
- Reactions:26
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Add equivalent cURL --resolve flag · Issue #99 · httpie/httpie ...
The underlying software that HTTPie uses does not allow people to specify their own IP addresses for a specific host. It's unlikely it...
Read more >Implementing the curl --resolve flag in python - Stack Overflow
I have to implement a curl command similar to this curl -XPOST -u $(<creds) -H ... the --resolve domain:port:ip flag using Requests library....
Read more >Use cURL's "--resolve" option to pin a request to an IP address
Use cURL's "--resolve" option to pin a request to an IP address ... Happily, this sort of "ad-hoc" request-pinning is possible via ...
Read more >curl.1 the man page
curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple...
Read more >curl --resolve - CaiusTheory
In later versions of curl there's a solution for this built into the binary, in the form of the --resolve flag. You can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The above trick doesn’t work for HTTPS sites. We need a full resolve option similar to curl.
In case anybody is confused as to why this is needed “for HTTPS”, it’s specifically when TLS SNI (Server Name Indication) is used in place of the HTTP Host header to disambiguate connections (e.g. hostname-based L7 routing in reverse-proxies, or “virtual server” use-cases in general), which is extremely common.
In that context, resolving the IP beforehand isn’t sufficient as it won’t constitute a virtual server name expected by the actual server.
If an equivalent to
--resolve
isn’t desirable for any reason, forcing the SNI value (e.g.--sni
) would be an acceptable alternative IMO since we can already do the equivalent for plain HTTP (i.e. set the Host header value explicitly).