question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add equivalent cURL --resolve flag

See original GitHub issue

Per 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:open
  • Created 11 years ago
  • Reactions:26
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
CMCDragonkaicommented, Oct 19, 2015

The above trick doesn’t work for HTTPS sites. We need a full resolve option similar to curl.

12reactions
tn-osimiscommented, Mar 23, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found