Skip to content

server: enable IPv6 LAN discovery - #1315

Open
HashimTheArab wants to merge 3 commits into
df-mc:masterfrom
HashimTheArab:fix/lan-ipv6-listener
Open

server: enable IPv6 LAN discovery#1315
HashimTheArab wants to merge 3 commits into
df-mc:masterfrom
HashimTheArab:fix/lan-ipv6-listener

Conversation

@HashimTheArab

@HashimTheArab HashimTheArab commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • listen on [::]:19133 by default alongside the IPv4 listener on :19132, using the server's existing multi-listener support (one Config.Listeners entry per address)
  • allow disabling or overriding the IPv6 listener through Network.AddressV6
  • preserve one server-wide player limit and advertised player count across both listeners via a shared gophertunnel ListenerGroup (minecraft: share player state between listeners Sandertv/gophertunnel#465)
  • if the IPv6 bind fails, log the error and keep serving on IPv4 instead of failing startup (conf.New previously appended a nil listener when a listener factory errored — fixed with continue)

PocketMine documents UDP 19133 as the IPv6 port used by Bedrock LAN discovery: https://github.com/pmmp/PocketMine-MP/blob/stable/changelogs/4.0.md#general

Note: the go.mod/go.sum churn comes from a temporary replace pointing at my gophertunnel fork with the ListenerGroup support; it will be dropped once gophertunnel tags a release including Sandertv/gophertunnel#465.

Validation

  • go test ./...
  • git diff --check

@HashimTheArab

Copy link
Copy Markdown
Collaborator Author

Blocked on Sandertv/gophertunnel#465. The temporary replace will be removed once the shared listener state is available upstream.

The server already fans in multiple listeners, so the multiListener
wrapper is unnecessary. listenerFunc is now parameterized by address
and both listeners share one gophertunnel ListenerGroup. A failed IPv6
bind now logs an error and leaves the IPv4 listener running instead of
failing both.
Comment thread go.mod
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.

3 participants