feature: initial implementation of avoiding local proxy if peers are in the same net

This commit is contained in:
braginini
2021-06-17 14:27:33 +02:00
parent 6465e2556a
commit 923cabda9a
3 changed files with 24 additions and 2 deletions
+9
View File
@@ -42,6 +42,15 @@ func (p *WgProxy) Close() error {
return nil
}
func (p *WgProxy) StartLocal(host string) error {
err := iface.UpdatePeer(p.iface, p.remoteKey, p.allowedIps, DefaultWgKeepAlive, host)
if err != nil {
log.Errorf("error while configuring Wireguard peer [%s] %s", p.remoteKey, err.Error())
return err
}
return nil
}
// Start starts a new proxy using the ICE connection
func (p *WgProxy) Start(remoteConn *ice.Conn) error {