Closed laurenceisla closed 7 months ago
I did a bit of testing, and here are my results:
127.0.0.1
binds to ipv4 only. :heavy_check_mark:::1
binds to ipv6 only. :heavy_check_mark:0.0.0.0
binds to ipv4 only. :heavy_check_mark:::
binds to ipv4 and ipv6. :no_entry_sign:*
binds to ipv4 only. :no_entry_sign:*4
binds to ipv4 only. :heavy_check_mark:*6
binds to ipv4 and ipv6. :no_entry_sign:!4
binds to ipv4 only. :heavy_check_mark:!6
binds to ipv4 and ipv6. :no_entry_sign:The docs are not entirely clear to me about what is correct for *4
and *6
- but surely the results are inconsistent here.
It seems like the HostPreference setting is from https://github.com/fpco/streaming-commons, though. Should we report this there?
Yes. Please provide this to streaming-commons.
Closing in favor of the upstream issue.
System info
OS: NixOS 23.05 Cabal: 3.10.1.0 GHC: 9.2.8 Dependencies:
Uname:
Issue
In
warp
, 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 in this Gist: https://gist.github.com/laurenceisla/61af763fb028437f24e5a869225eb1f8These are the results I got:
It allows both ipv4 and ipv6 requests when setHost !6
It does not allow ipv6 requests when setHost *
setHost !4 working as expected