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
+3
View File
@@ -14,6 +14,7 @@ import (
const (
defaultMTU = 1280
WgPort = 51820
)
// Saves tun device object - is it required?
@@ -85,10 +86,12 @@ func Configure(iface string, privateKey string) error {
return err
}
fwmark := 0
p := WgPort
cfg := wgtypes.Config{
PrivateKey: &key,
ReplacePeers: false,
FirewallMark: &fwmark,
ListenPort: &p,
}
err = wg.ConfigureDevice(iface, cfg)
if err != nil {