-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
We stumbled with this problem via Warp and opened an issue there: yesodweb/wai#976 (comment). But the problem was with how HostPreference was behaving which is defined in this project.
I'll copy the issue here:
Issue
When setting a !6
host preference it does not seem to bind to ipv6 exclusively, because ipv4 requests do not fail. Also, when setting the preference to *
, ipv6 requests fail when they shouldn't.
I included a simple example with Warp in this Gist: https://gist.github.com/laurenceisla/61af763fb028437f24e5a869225eb1f8
These are the results I got:
It allows both ipv4 and ipv6 requests when setHost !6
$ curl "http://localhost:3000" --ipv4 -I
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 08 Feb 2024 01:19:54 GMT
Server: Warp/3.4.0
Content-Type: text/plain
It does not allow ipv6 requests when setHost *
$ curl "http://localhost:3000" --ipv6 -I
curl: (7) Failed to connect to localhost port 3000 after 0 ms: Couldn't connect to server
setHost !4 working as expected
$ curl "http://localhost:3000" --ipv6 -I
curl: (7) Failed to connect to localhost port 3000 after 0 ms: Couldn't connect to server
develop7
Metadata
Metadata
Assignees
Labels
No labels