Skip to content

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

Closed
lelutin wants to merge 1 commit intopuremourning:masterfrom
lelutin:ipv6_localhost
Closed

Connection to gadgets on IPv6-enabled host is failing#876
lelutin wants to merge 1 commit intopuremourning:masterfrom
lelutin:ipv6_localhost

Conversation

@lelutin
Copy link
Contributor

@lelutin lelutin commented Aug 18, 2024

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.

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
Copy link
Owner

This change is Reviewable

@puremourning
Copy link
Owner

Thanks for the PR, but unfortunately, we force the use of IPv4 for the exact opposite reason! See 4206d0e 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
Copy link
Contributor Author

lelutin commented Aug 18, 2024

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

@puremourning
Copy link
Owner

As mentioned, this would regress existing fixes. IPv4 ain't going nowhere so I don't see any reason to change this. The workaround is trivial for the very few people who only listen on IPv6 addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants