This is not a itzg docker-minecraft-bedrock-server issue per-se, but a proposal to use the project to work around an issue.
Currently, the Bedrock clients do not support the "Happy Eyeballs" approach (see RFC 8305) when a DNS entry resolves to both an A (IPv4) and an AAAA (IPv6) record. Happy Eyeballs is meant to improve the user experience in dual-stack environments.
It proposes initiating a connection attempt over IPv6 first, and then shortly after over IPv4 in parallel, without waiting for the IPv6 attempt to fail. The client continues with whichever connection succeeds first, minimizing delays caused by unreachable or misconfigured networks or servers.
In the Bedrock cliebt however, when you enter a DNS name for a server, it uses only the first address returned, using the requested port.
Unfortunately, the Bedrock server has another limitation, so that IPv4 and IPv6 cannot use the same port (arguably one of the more questionable design choices in Bedrock).
Combining these two limitations, when using a DNS name that resolves to both IPv4 and IPv6, and with a fixed port for connections (which can only be valid for either IPv4 or IPv6), you effectively have a 50:50 chance of success.
As a result, you can find various forum entries and some bug reports recommending "fixes" such as disabling IPv6 or using a direct IP address instead of a hostname to avoid intermittent "cannot connect" errors.
I would like to propose a potential workaround which could be implemented at the container level. I.e., inbound requests on port 19133 over IPv4 could be mapped to port 19132 on IPv4, and vice versa, using e.g. iptables (to also allow using host network mode).
Before preparing a test or proposing a patch, feedback on this approach would be helpful.
Admittedly, this is a workaround implemented at the container level. However, given the lack of progress on the underlying issues in Bedrock (client and server) over several years, and with increasing adoption of dual-stack networking, the ITZG Bedrock server Docker container could address a problem that many users may not even be aware of proactively.
This is not a itzg docker-minecraft-bedrock-server issue per-se, but a proposal to use the project to work around an issue.
Currently, the Bedrock clients do not support the "Happy Eyeballs" approach (see RFC 8305) when a DNS entry resolves to both an A (IPv4) and an AAAA (IPv6) record. Happy Eyeballs is meant to improve the user experience in dual-stack environments.
It proposes initiating a connection attempt over IPv6 first, and then shortly after over IPv4 in parallel, without waiting for the IPv6 attempt to fail. The client continues with whichever connection succeeds first, minimizing delays caused by unreachable or misconfigured networks or servers.
In the Bedrock cliebt however, when you enter a DNS name for a server, it uses only the first address returned, using the requested port.
Unfortunately, the Bedrock server has another limitation, so that IPv4 and IPv6 cannot use the same port (arguably one of the more questionable design choices in Bedrock).
Combining these two limitations, when using a DNS name that resolves to both IPv4 and IPv6, and with a fixed port for connections (which can only be valid for either IPv4 or IPv6), you effectively have a 50:50 chance of success.
As a result, you can find various forum entries and some bug reports recommending "fixes" such as disabling IPv6 or using a direct IP address instead of a hostname to avoid intermittent "cannot connect" errors.
I would like to propose a potential workaround which could be implemented at the container level. I.e., inbound requests on port 19133 over IPv4 could be mapped to port 19132 on IPv4, and vice versa, using e.g. iptables (to also allow using host network mode).
Before preparing a test or proposing a patch, feedback on this approach would be helpful.
Admittedly, this is a workaround implemented at the container level. However, given the lack of progress on the underlying issues in Bedrock (client and server) over several years, and with increasing adoption of dual-stack networking, the ITZG Bedrock server Docker container could address a problem that many users may not even be aware of proactively.