@@ -2,6 +2,7 @@ package flashlight
22
33import (
44 "fmt"
5+ "github.com/getlantern/netx"
56 "net"
67 "sync"
78 "time"
@@ -12,7 +13,6 @@ import (
1213 "github.com/getlantern/errors"
1314 "github.com/getlantern/eventual/v2"
1415 "github.com/getlantern/golog"
15- "github.com/getlantern/netx"
1616 "google.golang.org/protobuf/proto"
1717
1818 "github.com/getlantern/flashlight/v7/apipb"
4949 }
5050)
5151
52- func init () {
53- if common .Platform != "ios" {
54- netx .EnableNAT64AutoDiscovery ()
55- }
56- }
57-
5852// HandledErrorType is used to differentiate error types to handlers configured via
5953// Flashlight.SetErrorHandler.
6054type HandledErrorType int
@@ -120,10 +114,14 @@ func New(
120114 eventWithLabel func (category , action , label string ),
121115 options ... Option ,
122116) (* Flashlight , error ) {
117+ if common .Platform != "ios" {
118+ netx .EnableNAT64AutoDiscovery ()
119+ }
123120 log .Debugf ("Running in app: %v" , appName )
124121 log .Debugf ("Using configdir: %v" , configDir )
125122 displayVersion (appVersion , revisionDate )
126- common .CompileTimeApplicationVersion = appVersion
123+ common .InitVersion (appVersion )
124+ proxied .InitFronted ()
127125 deviceID := userConfig .GetDeviceID ()
128126 log .Debugf ("You can query for this device's activity under device id: %v" , deviceID )
129127 fops .InitGlobalContext (
@@ -375,8 +373,6 @@ func (f *Flashlight) startConfigService() (services.StopFn, error) {
375373 var url string
376374 if cloudURL , _ := f .flagsAsMap ["cloudconfig" ].(string ); cloudURL != "" {
377375 url = cloudURL
378- } else if staging , _ := f .flagsAsMap ["staging" ].(bool ); staging {
379- url = common .UserConfigStagingURL
380376 } else {
381377 url = common .UserConfigURL
382378 }
0 commit comments