Conversation
Running socat twice should cover most setups: - On "normal" dual-stack setups, the IPv6 listen creates a dual-stack socket and the IPv4 listen then fails - On dual-stack setups with `bindv6only` enabled, both socat processes will succeed. - On systems with IPv6 disabled, the first socat call will fail and the second will create a proper IPv4 listening socket
|
@TobiX I understand the necessity of this, but before I merge it, I want to think about if this is the best way for this. I really didn't like that I had to fork/add |
|
I think headless-shell (and normal chrome, too?) just ignores the I found multiple places in the Chromium source which reads those options, only one parses the address switch:
(Listening code is probably this one? https://github.com/chromium/chromium/blob/f84ed0f1583f88581b9d4093b7459103066cb1bd/headless/lib/browser/headless_devtools.cc#L41) Stupid sidenode: The local listening code is written in a way to support systems without IPv4 stack (it does IPv6 localhost only after IPv4 localhost fails) - That's certainly a choice 😺 It seems the Chrome developers really don't like debugging servers on anything non-localhost, see: https://chromium-review.googlesource.com/c/chromium/src/+/5512634 😞 We could switch socat to a different tool with dedicated IPv6 support, but I didn't find anything adequate in my short search... So here is another (stupid) idea to solve the problem: Add an Footnote: In most cases my change doesn't add an additional socat process, since one socat is enough for a dual-socket listener. Unfortunately, socat has no internal support for "proper" dual-stack support, so I had to resort to the two-call workaround... |
|
@kenshaw I commited crimes: https://codeberg.org/TobiX/listenany - this was more a test to see it was possible, it doesn't cover any edge-cases yet (IPv4- or IPV6-only systems, non-standard bindv6only settings) PS: Chromium's internal webserver has another don't-do-that gate: It checks the Host header and only allows |
Running socat twice should cover most setups:
bindv6onlyenabled, both socat processes will succeed.This should help on most systems with "proper" IPv6 setup, especially with recent podman versions, which creates both, an IPv4 and an IPv6 forward, when using
-p 9222:9222', which leads to the situation that if the container only provides an IPv4 listening socket, requests tolocalhostfail with an unhelpfulConnection reset by peer`:vs.