-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add equivalent cURL --resolve flag #99
Comments
I think you can achieve the same thing by explicitly setting the
|
The above trick doesn't work for HTTPS sites. We need a full resolve option similar to curl. |
I'm using httpie to test that I setup my DNS round-robin correctly. +1 for feature |
Just curious... This has been open for over a year now (since it was reopened)... any chance it's getting looked at? Seems like a useful feature to have. |
The underlying software that HTTPie uses does not allow people to specify their own IP addresses for a specific host. It's unlikely it will be added there. So, @aztlan2k it's not likely this is being worked on. Sorry. :/ |
Hi! I've submitted some code and would appreciate any comments. |
Just re-submitted via another PR. Would you mind to check? |
Any chance of getting this merged? @jakubroztocil |
That would be great to prepare site migration and avoid problems! |
This can be achieved via |
|
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 |
This can also be useful for absolute redirects (That include a full URL with a host name) |
Looking into it, there are basically two options how to fix this:
The strong preference would be for the first solution. Custom wrapping and monkeypatching often leads to unintended consequences as the Python interpreter and surrounding libraries develop and often leads to "hidden" bugs. Help with getting the patch rolling for the urllib3 would be very welcome! Otherwise, we may look into it in the future, but other features have higher priority. |
Greetings! I just realized this thread is over 10 years old. |
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
The text was updated successfully, but these errors were encountered: