This commit is contained in:
jdl
2026-06-09 06:08:14 +02:00
parent c258d877e8
commit 3968fd8f16
3 changed files with 15 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ func (a *App) onAddPeer(p HubPeer) {
if !peer.IsPublic {
a.devAddPeer(peer)
if a.forwarder != nil && endpoint.IsValid() {
a.forwarder.SetEndpoint(peer.VPNIP.As4()[3], endpoint)
}
return
}
@@ -50,6 +53,9 @@ func (a *App) onRemovePeer(key wgtypes.Key) {
return
}
a.devRemove(peer)
if a.forwarder != nil {
a.forwarder.RemoveEndpoint(peer.VPNIP.As4()[3])
}
delete(a.peersByKey, key)
delete(a.peersByIP, peer.VPNIP)