IPv6 Loopback and localhost proxy

There seem to be a number of issues with the IPv6 loopback setting, particularly on Mac where .local domains conflict with Bonjour. It would be great to get a fuller understanding of what is happening here beyond just turning the setting off and on.

A scenario:
My site is mysite.local. With IPv6 turned off, it loads snappy, as expected. With IPv6 turned on, it loads the “It Works” page, so it’s not routing correctly.

When I use webpack to proxy localhost:3000 to mysite.local with IPv6 turned off, accessing localhost:3000 takes 5-6 seconds to resolve the domain name, typical when there’s a conflict with Bonjour. With IPv6 turned on, localhost:3000 loads snappy.

Turning IPv6 off and on every time start or stop my proxy server isn’t very elegant. What is happening here? Is it possible to have mysite.local and localhost:3000 load snappy without routing errors or DNS conflicts?

Hey there! Local Lightning might help fix some of these bugs. If you’re interested in joining the beta, DM your email and we’ll get you enrolled in the program.

@LocalbyFlywheel on Twitter