pufferffish / wireproxy

Wireguard client that exposes itself as a socks5 proxy
ISC License
4.11k stars 235 forks source link

send a keepalive after establishing a connection #52

Closed 0ff closed 1 year ago

0ff commented 1 year ago

This PR adds a call to send a keepalive right after the Wireguard connection was established. This leads to the proxy being available on the Wireguard network right away, instead of just after the first keepalive package was sent / the first byte is sent from the proxy.

This is especially important for using the proxy without opening a SOCKS proxy, as this would otherwise not send any traffic from the proxy and thus it would not be available on the Wireguard network.

This should close https://github.com/octeep/wireproxy/issues/38

pufferffish commented 1 year ago

I've tested the PR and it doesn't seem to fix the issue. Have you tested it and does it work for you?

0ff commented 1 year ago

Oh wow, you're right - it seems that I've added PersistentKeepalive = 90 to the config I've used for testing this PR, and that fixed the issue.

Sorry, I'll investigate a bit more and if I can't (really) fix it, I'll just close the PR.

0ff commented 1 year ago

Yeah I fear I cannot easily fix that; it seems there's no API on device.Device to force a keepalive if PersistentKeepalive is unset. Sorry to bother you here!