-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the proper way to host a server on both IPv4 and IPv6? #510
Comments
You can set |
Wow I completely forgot about that. Now I feel dumb. Let me test that. |
Yeah, no. That doesn't work. I can set |
See golang/go#9334 I suspect writing something that muxes net.Listeners would have a significant performance impact. |
That makes sense. I guess one workaround would be to have two seperate instances that share a redis database to share peers. I feel like that'd impact performance a lot. Still, that doesn't really seem to explain why I hadn't tested this but I just thought of this and I wonder if it is binding to IPv6 but somewhere along the line it's defaulting to IPv4 so it's expecting IPv4 but getting IPv6 with some connections and returning an error or something. |
I run totally separate copies of the software for my public ipv4/ipv6 addresses. It works well, but my tracker is totally public. Hopefully PEX is doing some work for me here. |
I actually think that's not a bad approach. IPv4 clients can only talk to other IPv4 clients, and vice versa for IPv6. There's the IPv4-in-IPv6 addresses, but afaik that's just syntactic sugar done by the OS to make it easier to develop IPv6-only applications. Running two instances has a tiny and constant memory overhead for some data structures, but I wouldn't be surprised if it performed on par or even better than one monolithic tracker with two frontends. We could optimize this case by differentiating between IPv4 and IPv6 storage implementations to potentially save 16 bytes per peer per swarm. |
Yeah I guess if you are only listening on one type of address, that could be communicated to the storage layer. I don't know if that matters in practice. Envelope math says I'd save 100 megabytes of ram on the v4 instance (5 million peers+seeds * 16 bytes). |
There's the
addr:
field but it doesn't seem to accept an array so I'm not entirely sure how I'm supposed to bind to both IPv4 and IPv6 with the same instance. Any help would be appreciated.The text was updated successfully, but these errors were encountered: