Skip to content
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 -4 and -6 switches to force IP protocol version #94

Open
ThiefMaster opened this issue Oct 2, 2012 · 7 comments · May be fixed by #1531
Open

Add -4 and -6 switches to force IP protocol version #94

ThiefMaster opened this issue Oct 2, 2012 · 7 comments · May be fixed by #1531
Labels
blocked by upstream The issue is in a dependency. We are waiting for the upstream library to lay the groundwork. enhancement New feature or enhancement

Comments

@ThiefMaster
Copy link

Would be useful in some cases, e.g. when a host serves different responses depending on the IP version.

-4and -6 are pretty common for this anyway.

@berkant
Copy link

berkant commented Aug 7, 2020

No updates since 8 years?

@Almad
Copy link

Almad commented Feb 3, 2021

We'd love to fix this, but when looking into it, we see it still blocked in the underlying libraries. We'll keep looking for solutions, but we can't promise any timeline since we don't see any easy fix.

Help or pointers very welcome!

@dwt
Copy link

dwt commented Feb 3, 2021

@Almad could you give some pointers on this bug what kind of blockers you see, so whoever is interested in helping here doesn't have to dig out that information again? Thanks!

@Almad
Copy link

Almad commented Feb 3, 2021

Ah, apologies, somehow thought it's linked here— psf/requests#1691

@markstos
Copy link

For http (not https), there's a workaround in that you can give the hostname as an IPv6 IP address, and pass the host name as Host:example.com (with your real target domain).

https --print=Hh https://[YOUR-IPv6-ADDR-IN-BRACKETS]/ Host:example.com

It doesn't work for HTTPS because the SSL certificate is assigned to a host name that doesn't match the IP you are connecting to.

It looks like to really fix this, a different upstream library would needed, as it seems the current one is not going to support this (or can't).

@Ousret
Copy link
Collaborator

Ousret commented May 17, 2024

This is most likely fixed by #1531
If the project owner agrees to merge it.

Meanwhile, you may try it (the patch) yourself.

pip install "git+https://github.com/Ousret/HTTPie.git@feature-tryout-niquests" -U

And do https -4 https://pie.dev/get or https -6 https://pie.dev/get

@markstos
Copy link

@Ousret I tested that fork and found that the -4 and -6 flags both worked as expected. Thank you.

I installed privately with pipx to not conflict with a global version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by upstream The issue is in a dependency. We are waiting for the upstream library to lay the groundwork. enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants