summaryrefslogtreecommitdiff
path: root/pkg/backend/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/backend/init.go')
-rw-r--r--pkg/backend/init.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index c6d713b..fae5ff1 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -58,6 +58,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
bitmask.InitializeLogger()
ctx.cfg = config.ParseConfig()
setConfigOpts(opts, ctx.cfg)
+ ctx.UseUDP = ctx.cfg.UDP
err := pid.AcquirePID()
if err != nil {
@@ -92,6 +93,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
ctx.IsReady = true
}
+// transfer initialization options from the config json to the config object
func setConfigOpts(opts *InitOpts, conf *config.Config) {
conf.SkipLaunch = opts.SkipLaunch
if opts.StartVPN != "" {
@@ -104,6 +106,9 @@ func setConfigOpts(opts *InitOpts, conf *config.Config) {
if opts.Obfs4 {
conf.Obfs4 = opts.Obfs4
}
+ if opts.UDP {
+ conf.UDP = opts.UDP
+ }
if opts.DisableAutostart {
conf.DisableAutostart = opts.DisableAutostart
}