Open itzg opened 2 years ago
This looks really interesting. Could you elaborate a bit more on how you want to implement this feature? Something like craftignite as discussed in itzg/docker-minecraft-server#874?
Basically I'm wanting to bring the minimal bits of knockd into mc-server-runner. Specifically the ability to watch for, but not proxy, incoming TCP packets to port 25565. From what I can tell BPF is the Linux kernel mechanism that seems to be best suited for doing that efficiently.
On the other side of the solution mc-server-runner already knows how to exec the Java process, gracefully stop it, and of course knows whether the server is actively running or not.
Another eBPF library to research: https://github.com/cilium/ebpf
I have some ideas with using https://pkg.go.dev/github.com/google/gopacket/pcapgo , BPF, and adding
CAP_BPF
capability to the executable at build time.