diff options
Diffstat (limited to 'bitmask_go/vpn.go')
-rw-r--r-- | bitmask_go/vpn.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bitmask_go/vpn.go b/bitmask_go/vpn.go index 041a8e4..c62e27c 100644 --- a/bitmask_go/vpn.go +++ b/bitmask_go/vpn.go @@ -81,13 +81,20 @@ func (b *Bitmask) VPNCheck() (helpers bool, priviledge bool, err error) { // ListGateways return the names of the gateways func (b *Bitmask) ListGateways(provider string) ([]string, error) { - // TODO - return []string{}, nil + gateways, err := b.bonafide.getGateways() + if err != nil { + return nil, err + } + gatewayNames := make([]string, len(gateways)) + for i, gw := range gateways { + gatewayNames[i] = gw.Location + } + return gatewayNames, nil } // UseGateway selects name as the default gateway func (b *Bitmask) UseGateway(name string) error { - // TODO + b.bonafide.setDefaultGateway(name) return nil } |