This commit is contained in:
jdl
2026-06-09 07:40:06 +02:00
parent 3968fd8f16
commit 1c304767b8
5 changed files with 46 additions and 12 deletions

View File

@@ -47,6 +47,13 @@ func (a *App) devAddDirect(p *Peer, endpoint netip.AddrPort) {
p.State = StateDirect
}
func (a *App) devAddRelayed(p *Peer, relayVPNIP netip.Addr) {
port := ForwarderBasePort + uint16(p.VPNIP.As4()[3])
endpoint := netip.AddrPortFrom(relayVPNIP, port)
devRetry(p.VPNIP, "AddRelayed", func() error { return a.dev.AddDirect(p.PubKey(), endpoint, p.VPNIP) })
p.State = StateRelayed
}
func (a *App) devSetRelay(p *Peer, endpoint netip.AddrPort) {
devRetry(p.VPNIP, "SetRelay", func() error { return a.dev.SetRelay(p.PubKey(), endpoint, a.vpnNet) })
}