send a keepalive after establishing a connection

This commit is contained in:
Fabian Off 2022-11-26 09:22:47 +01:00 committed by GitHub
parent 6b83c00c46
commit 82047e419a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,6 +74,9 @@ func StartWireguard(conf *DeviceConfig) (*VirtualTun, error) {
return nil, err return nil, err
} }
// Sending a keepalive directly after connecting makes the wireproxy reachable instantly
dev.SendKeepalivesToPeersWithCurrentKeypair()
return &VirtualTun{ return &VirtualTun{
tnet: tnet, tnet: tnet,
systemDNS: len(setting.dns) == 0, systemDNS: len(setting.dns) == 0,