natpunch-go
natpunch-go copied to clipboard
Windows Client
Hello Malcolm,
I'm interested in porting your excellent Client to Windows. What would be the best way to start that effort? Do you have any prior work on it?
I will definitely push this upgrade back to your project. Just want to find out your thoughts.
Thanks, Keith
I'm glad you're interested! Somebody else was too and built this: https://github.com/yinheli/udppunch. I'd recommend checking that out first, they seem to have a Windows build in their Releases.
If that doesn't work, then here's the steps I'd take to make this cross-platform:
- Use the official wgctrl library for controlling Wireguard.
- Use a net.IPConn with a UDP header manually serialized to spoof Wireguard's source port when contacting the server.
- Use a separate connection for most of your communication with the server so that you never have to read from the net.IPConn. The current implementation uses Linux-only BPF and does all communication over an ipv4.RawConn.
I hope you found this helpful! Let me know if you have any other questions.