Skip to content

Revert "always use ipv4"#23

Open
tamara-schmitz wants to merge 1 commit intomat-1:masterfrom
tamara-schmitz:master
Open

Revert "always use ipv4"#23
tamara-schmitz wants to merge 1 commit intomat-1:masterfrom
tamara-schmitz:master

Conversation

@tamara-schmitz
Copy link
Copy Markdown

@tamara-schmitz tamara-schmitz commented Jul 16, 2025

This reverts commit d496f37.

Patch was tested and fixes connectivity issues on my end.

My server is hosted on an IPv6-only network with NAT64 and DNS64. Hence while ping, curl etc. works just fine towards IPv4-only hosts, with metasearch2 it fails with "Network unreachable", because yeah, that host is on no IPv4 network.

Reqwest makes reasonable decisions based on what getaddrinfo returns and which network protocols are configured on the local interfaces.

More background on how NAT64 works:
The network only assigns an IPv6 address to clients. If you do a DNS query for an IPv4-only domain, the local DNS server returns a NAT64 IP starting which is 64:ff9b:: + the IPv4 address. Requests to 64:ff9b::/96 are then handled by the NAT64 gateway.

This reverts commit d496f37.

My server is hosted on an IPv6-only network with NAT64 and DNS64.
Hence while ping, curl etc. works just fine towards IPv4-only hosts,
with metasearch2 it fails with "Network unreachable".

Reqwest makes reasonable decisions based on what geaddrinfo returns
and which network protocols are configured on the local interfaces.
@raylu
Copy link
Copy Markdown
Contributor

raylu commented Sep 11, 2025

this works fine on my dual IPv4/IPv6 system too

reqwest uses hyper which appears to support happy eyeballs hyperium/hyper#1316 (comment) so it should Just Work™ in most cases

if @mat-1 or someone is having trouble with it, perhaps a config option would help? (though in those situations, you probably wanna just disable IPv6 on the device instead, since every other app that doesn't do happy eyeballs is gonna run into issues too)

@raylu
Copy link
Copy Markdown
Contributor

raylu commented Sep 11, 2025

hmm... I take that back. IPv6 seems to work for marginalia but I'm not getting results for google, even though the hidden progress-updates thing says it got a response and parsed it

@mat-1
Copy link
Copy Markdown
Owner

mat-1 commented Sep 13, 2025

This is probably fine and I don't remember why I added it anyways. I'll merge this and maybe add a config option when I have the time to test.

@raylu
Copy link
Copy Markdown
Contributor

raylu commented Sep 21, 2025

did some debugging. on IPv6, google is returning

Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><br>

<div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of Service</a>. The block will expire shortly after those requests stop.  In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="//support.google.com/websearch/answer/86640">Learn more</a><br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known
to use, or sending requests very quickly.
</div>

@tamara-schmitz
Copy link
Copy Markdown
Author

tamara-schmitz commented Sep 22, 2025

did some debugging. on IPv6, google is returning

Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><br>

<div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of Service</a>. The block will expire shortly after those requests stop.  In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="//support.google.com/websearch/answer/86640">Learn more</a><br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known
to use, or sending requests very quickly.
</div>

This to me seems ISP specific. And I cannot replicate that with my ISP. But since this is so network specific, it could be nice to have a configurable IPv4 only option.

@raylu
Copy link
Copy Markdown
Contributor

raylu commented Sep 22, 2025

sadly, it's a bit difficult to make anything about CLIENT a config
#27 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants