diff options
Diffstat (limited to 'pkg/bitmask')
-rw-r--r-- | pkg/bitmask/init.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index bc7d47d..a03a64b 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -95,6 +95,11 @@ func InitializeBitmask(conf *config.Config) (Bitmask, error) { return nil, err } + err = setUDP(b, conf) + if err != nil { + return nil, err + } + if !conf.SkipLaunch { err := maybeStartVPN(b, conf) if err != nil { @@ -119,6 +124,18 @@ func setTransport(b Bitmask, conf *config.Config) error { return nil } +func setUDP(b Bitmask, conf *config.Config) error { + if conf.UDP { + log.Printf("Use UDP") + err := b.UseUDP(true) + if err != nil { + log.Printf("Error setting UDP: %v", err) + return err + } + } + return nil +} + func maybeStartVPN(b Bitmask, conf *config.Config) error { if !conf.StartVPN { return nil |