Skip to content

Conversation

AlexisEvo
Copy link

@AlexisEvo AlexisEvo commented Sep 4, 2025

This PR tries to fix three common crashes I've seen users encounter on Discord.

  1. C#'s HttpClient does not fall back to IPv4 if it fails to establish an IPv6 connection ("happy eyeballs"). On a poorly configured network, where the user's router provides their PC an IPv6 address, and their DNS provides an AAAA record, but they are unable to connect to an IPv6 host, this causes HttpClient to stall for 100 seconds before raising an exception. This is, unfortunately, very common. An ideal solution would be to attempt to connect to IPv6, then fallback to IPv4. This PR just forces IPv4. This PR now includes proper IPv6 -> IPv4 failover.
  2. VRCFT often crashes when trying to setup multicast on VPN or VMware/Hyper-V/etc network adapters. Additional filtering in GetIpv4NetInterfaces to attempt to resolve this.
  3. VRCFT will crash if a network interface has two IP addresses assigned to it. We only need to setup multicast on one of them.

@InconsolableCellist
Copy link
Collaborator

For #1, what happens if a user has a properly configured IPv6-only network or a network interface that doesn't have an IPv4 address assigned, just an IPv6 one? If it forces IPv4 won't it break for those users?

@AlexisEvo
Copy link
Author

If their access to the internet is only available via IPv6 then yes this would unfortunately break for them -- like I said an ideal solution would be to failover. This was a quick fix because I'm tired of recommending people to disable IPv6 on their computer entirely to workaround it.
Realistically I don't think it's likely any such users exist. If they do, VRCFT should already broken for them, because VRCFT depends on this call to GitHub API which does not have an AAAA record:

root@gl:~# dig api.github.com AAAA +short
root@gl:~#

So if they don't have IPv4, this would throw an exception and crash. Most of the registry modules are also hosted on GitHub, though VRCFT should be fine if that is unreachable.

or a network interface that doesn't have an IPv4 address assigned, just an IPv6 one?

Windows would route the IPv4 request over the network interface with an IPv4 gateway, so this scenario should be fine.

@AlexisEvo
Copy link
Author

Alright, I added an HttpClient wrapper that implements a basic version of "happy eyeballs" (I really hate this name). If IPv6 is unreachable or times out, it will fall back to IPv4.

Copy link
Collaborator

@InconsolableCellist InconsolableCellist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, and I too hate the name from the RFC, "Happy Eyeballs." Leave it to Apple.

But this does look like it'll resolve the issue of IPv6 being assigned but not usable on a network. I haven't personally had problems with VRCFT crashing due to VPNs, at least not that I've noticed. I think, however, this is ready for testing in a future pre-release.

@AlexisEvo
Copy link
Author

I sent this build to someone on Discord that had this broken IPv6 configuration and they confirmed the IPv4 failover works. I tried my best to replicate it when testing this PR, but it's good to see it actually work in the wild.

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