diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-11-25 13:45:54 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-29 18:14:05 +0100 |
commit | b7b19b7195366dbacc4078b5b7a3fc6a3ad7889b (patch) | |
tree | 2b97e0167d507ddd9c1b5b0d5f0d3efbc4e6829c /pkg/config | |
parent | a81bf938fe2b9409d1fa0175cc5f20635bb16127 (diff) |
[feat] expose snowflake in preferences
it will be disabled if Tor not present, for now
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/gui.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/config/gui.go b/pkg/config/gui.go index 6004d20..1d23018 100644 --- a/pkg/config/gui.go +++ b/pkg/config/gui.go @@ -42,12 +42,14 @@ type Config struct { UserStoppedVPN bool DisableAutostart bool UDP bool + Snowflake bool } SkipLaunch bool Obfs4 bool DisableAutostart bool StartVPN bool UDP bool + Snowflake bool } // ParseConfig reads the configuration from the configuration file @@ -66,6 +68,8 @@ func ParseConfig() *Config { conf.Obfs4 = conf.file.Obfs4 conf.DisableAutostart = conf.file.DisableAutostart conf.StartVPN = !conf.file.UserStoppedVPN + conf.UDP = conf.file.UDP + conf.Snowflake = conf.file.Snowflake return &conf } @@ -104,6 +108,12 @@ func (c *Config) SetUseUDP(val bool) error { return c.save() } +func (c *Config) SetUseSnowflake(val bool) error { + c.Snowflake = val + c.file.Snowflake = val + return c.save() +} + func (c *Config) save() error { f, err := os.Create(configPath) if err != nil { |