Skip to content

feat: Add Happy Eyeballs (RFC 8305) support for fast dual-stack fallback#33

Open
404Setup wants to merge 1 commit into26.1-newfrom
happy-eyeballs-fast-fallback-4835996952804785933
Open

feat: Add Happy Eyeballs (RFC 8305) support for fast dual-stack fallback#33
404Setup wants to merge 1 commit into26.1-newfrom
happy-eyeballs-fast-fallback-4835996952804785933

Conversation

@404Setup
Copy link
Owner

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 happyEyeballs config option.


PR created automatically by Jules for task 4835996952804785933 started by @404Setup

- 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`.
@google-labs-jules
Copy link

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant