feat: Add Happy Eyeballs (RFC 8305) support for fast dual-stack fallback#33
feat: Add Happy Eyeballs (RFC 8305) support for fast dual-stack fallback#33
Conversation
- Implemented `HappyEyeballsConnect` to race IPv4 and IPv6 connection attempts, providing a 250ms head start to IPv6 as per RFC 8305. - Created `HEConnectHandler` to manage the parallel Netty connections and safely inject the Minecraft `Connection` handler into the winning pipeline. - Added `ClientConnectionMixin` to intercept `Connection.connectToServer` and delegate to the new Happy Eyeballs logic when enabled. - Added `happyEyeballs` boolean toggle to `ModConfig` (default: false) to allow users to opt-in to the fast fallback behavior. - Registered the new mixin in `krypton_fnp.mixins.json` and `ModMixinBootstrap`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces "Happy Eyeballs" (Fast Fallback, RFC 8305) support to the Minecraft client connection sequence.
When a server hostname resolves to both IPv4 and IPv6 addresses (dual-stack), standard Minecraft only connects to the first returned address, leading to long timeouts or complete connection failures if that specific route is broken.
This patch intercepts the connection logic before reverse-DNS resolution, looks up both A and AAAA records, and races the TCP connection attempts using Netty. IPv6 is given a 250ms head start. The fastest successful connection is handed over to the Minecraft network pipeline, and the slower connection is closed. This significantly improves responsiveness and reliability for users on imperfect dual-stack networks.
The feature is disabled by default to prevent triggering aggressive anti-spam "Connection Throttled" plugins on legacy servers. It can be enabled via the
happyEyeballsconfig option.PR created automatically by Jules for task 4835996952804785933 started by @404Setup