spacemeowx2 / switch-lan-play

Enjoy games with your friends as if you were on a LAN.
GNU General Public License v3.0
1.82k stars 190 forks source link

DHCP server so we don't have to pick an IP #113

Open ioistired opened 3 years ago

ioistired commented 3 years ago

The LAN play website reads "The IP address can be any from 10.13.0.1 to 10.13.255.254, excepting 10.13.37.1. But don't use the same IP address with your friend.". It would be nice if the LAN play client acted as a DHCP server so that we don't have to do this ourselves.

drizuid commented 3 years ago

A dhcp server will usually issue IPs starting from the bottom and going up; If your local client instance hands you a dhcp address, there's not a mechanism to ensure you don't conflict with another user connected to your server (in fact, every user would conflict as they'd all get the first available ip) There could be an argument to do this server side and have the server issue an ip (or multiple ) to the client upon connection, but that's a lot of work for little gain.

ioistired commented 3 years ago

Could the client communicate with the lan play server to determine which IPs are available and then issue accordingly?

drizuid commented 3 years ago

Could the client communicate with the lan play server to determine which IPs are available and then issue accordingly?

from a technical perspective, yes, i briefly commented on this in my first post as a possibility; the down side is that it's quite a lot of work to do so. From the docker perspective, sticking coredns in the container could work, but for those running a server outside of a container and/or linux, now we're looking at greater issues; it's really not worth baking a dns server into the single executable.. obviously this is up to space (or a clever user who submits a suitable PR, but personally, i think the ask is too much for to little gain.