diff options
Diffstat (limited to 'pkg/vpn/status.go')
-rw-r--r-- | pkg/vpn/status.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pkg/vpn/status.go b/pkg/vpn/status.go index 647cf27..0b04c3b 100644 --- a/pkg/vpn/status.go +++ b/pkg/vpn/status.go @@ -74,12 +74,17 @@ func (b *Bitmask) eventHandler(eventCh <-chan openvpn.Event) { } if statusName == "CONNECTED" { ip := strings.Split(stateEvent.String(), ": ")[1] - gw, err := b.bonafide.GetGatewayByIP(ip) - if err == nil { - b.onGateway = gw - log.Println("Connected to gateway:", b.onGateway.Host) + if ip == "127.0.0.1" { + // we're using pluggable transports + b.onGateway = b.ptGateway } else { - log.Println("ERROR: connected to unknown gateway", ip) + gw, err := b.bonafide.GetGatewayByIP(ip) + if err == nil { + b.onGateway = gw + log.Println("Connected to gateway:", b.onGateway.Host) + } else { + log.Println("ERROR: connected to unknown gateway", ip) + } } } } |