puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.08k stars 171 forks source link

Connection to gadgets on IPv6-enabled host is failing #876

Open lelutin opened 3 weeks ago

lelutin commented 3 weeks ago

On hosts where IPv6 is enabled and preferred by the system, gadgets might be listening to ::1 instead of 127.0.0.1. In those situations, vimspector times out, unable to connect to the gadget even though they've both agreed about which port to use.

Changing the default host value to 'localhost' makes it possible for IPv6-enabled hosts to use the same default in vimspector than in the gadgets.

puremourning commented 3 weeks ago

This change is Reviewable

puremourning commented 3 weeks ago

Thanks for the PR, but unfortunately, we force the use of IPv4 for the exact opposite reason! See 4206d0e5 for example.

There were a swathe of issues when using localhost because for some unspeakable reason certain OS distributions default to using IPv6 and so just hang when using localhost, and most servers are using IPv4 for this comms.

I think if your server uses IPv6 by default, you just need to set host to ::1 when connecting.

lelutin commented 3 weeks ago

Oh I see, thanks for the details. It's a bit unfortunate to still be defaulting to ipv4 nowadays but I can understand that ipv6 has still not established its hegemony and so ipv4 keeps on being the safe default.

So instead of this MR, maybe we could add a quick mention of the default value (and thus address family) for host somewhere? The most relevant place I could find was in https://puremourning.github.io/vimspector/configuration.html#debug-adapter-configuration but we could also drop a note in https://github.com/puremourning/vimspector/wiki/Additional-Language-Support#gadget-installer-files