You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IPv6 host :: is kind of analogous to the IPv4 address 0.0.0.0, however it should usually (depending on the OS) listen for traffic coming from IPv4 and IPv6 addresses, unless specified differently by the OS.
However, i have observed that across different linux distros i have tried (manjaro, arch, debian), WEBRick will open its socket in ipv6-only mode.
I assume that the reason is this line as using the Socket.tcp_server_sockets function manually leads to the same result.
However, e.g. using the TCPServer from the socket stdlib opens a socker that's not in ipv6-only mode.
I have tested this with webrick 1.7.0 on ruby 3.1.1 and on ruby 2.6.3, both yielding the same result.
I have observed the mode using ss -tlne, where the local address is shown as [::]:8080, which indicates ipv6-only mode in ss, while it should be *:8080 in non-ipv6-only mode.
It also says v6only:1 in the process description, while it should say v6only:0.
Also here's the sample code using TCPServer that correctly opens the socket:
Does anyone have a workaround for this to force webrick to serve on both IPv4 and IPv6?
I'm using jekyll serve, which uses WEBrick under the hood, and chrome randomly chooses IPv4 vs IPv6, even if I explicitly go to http://127.0.0.1:4000 or http://[::1]:4000. This means that half the assets on my page fail to load because some connect over IPv4 and some over IPv6, and only one or the other are actually hitting a listening port.
The IPv6 host
::
is kind of analogous to the IPv4 address0.0.0.0
, however it should usually (depending on the OS) listen for traffic coming from IPv4 and IPv6 addresses, unless specified differently by the OS.However, i have observed that across different linux distros i have tried (manjaro, arch, debian), WEBRick will open its socket in ipv6-only mode.
I assume that the reason is this line as using the
Socket.tcp_server_sockets
function manually leads to the same result.However, e.g. using the
TCPServer
from thesocket
stdlib opens a socker that's not in ipv6-only mode.Sample code i have used:
I have tested this with webrick 1.7.0 on ruby 3.1.1 and on ruby 2.6.3, both yielding the same result.
I have observed the mode using
ss -tlne
, where the local address is shown as[::]:8080
, which indicates ipv6-only mode inss
, while it should be*:8080
in non-ipv6-only mode.It also says
v6only:1
in the process description, while it should sayv6only:0
.Also here's the sample code using
TCPServer
that correctly opens the socket:The text was updated successfully, but these errors were encountered: