diff options
Diffstat (limited to 'pkg/vpn/bonafide/bonafide.go')
-rw-r--r-- | pkg/vpn/bonafide/bonafide.go | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/pkg/vpn/bonafide/bonafide.go b/pkg/vpn/bonafide/bonafide.go index b4e6af0..907bba5 100644 --- a/pkg/vpn/bonafide/bonafide.go +++ b/pkg/vpn/bonafide/bonafide.go @@ -25,10 +25,12 @@ import ( "io/ioutil" "log" "net/http" + "os" "strings" "time" "0xacab.org/leap/bitmask-vpn/pkg/config" + "0xacab.org/leap/bitmask-vpn/pkg/snowflake" ) const ( @@ -234,18 +236,22 @@ func (b *Bonafide) getURLNoDNS(object string) string { } func (b *Bonafide) maybeInitializeEIP() error { - if b.eip == nil { - err := b.fetchEipJSON() - if err != nil { - return err + if os.Getenv("SNOWFLAKE") == "1" { + snowflake.BootstrapWithSnowflakeProxies() + } else { + if b.eip == nil { + err := b.fetchEipJSON() + if err != nil { + return err + } + b.gateways = newGatewayPool(b.eip) } - b.gateways = newGatewayPool(b.eip) - } - // FIXME: let's update the menshen gateways every time we 'maybe initilize EIP' - // in a future we might want to be more clever on when to do that - // (when opening the locations tab in the UI, only on reconnects, ...) - b.fetchGatewaysFromMenshen() + // FIXME: let's update the menshen gateways every time we 'maybe initilize EIP' + // in a future we might want to be more clever on when to do that + // (when opening the locations tab in the UI, only on reconnects, ...) + b.fetchGatewaysFromMenshen() + } return nil } |