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/backend/status.go | |
parent | a81bf938fe2b9409d1fa0175cc5f20635bb16127 (diff) |
[feat] expose snowflake in preferences
it will be disabled if Tor not present, for now
Diffstat (limited to 'pkg/backend/status.go')
-rw-r--r-- | pkg/backend/status.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/backend/status.go b/pkg/backend/status.go index 2ed5cfd..de6364f 100644 --- a/pkg/backend/status.go +++ b/pkg/backend/status.go @@ -8,6 +8,7 @@ import ( "0xacab.org/leap/bitmask-vpn/pkg/bitmask" "0xacab.org/leap/bitmask-vpn/pkg/config" + "0xacab.org/leap/bitmask-vpn/pkg/snowflake" ) const ( @@ -57,6 +58,8 @@ type connectionCtx struct { IsReady bool `json:"isReady"` CanUpgrade bool `json:"canUpgrade"` Motd string `json:"motd"` + HasTor bool `json:"hasTor"` + UseSnowflake bool `json:"snowflake"` bm bitmask.Bitmask autostart bitmask.Autostart cfg *config.Config @@ -73,11 +76,13 @@ func (c *connectionCtx) toJson() ([]byte, error) { c.CurrentCountry = c.bm.GetCurrentCountry() c.BestLocation = c.bm.GetBestLocation(transport) c.Transport = transport - c.UseUDP = c.cfg.UDP // TODO initialize bitmask too + c.UseUDP = c.cfg.UDP // TODO initialize bitmask param? c.OffersUDP = c.bm.OffersUDP() + c.UseSnowflake = c.cfg.Snowflake // TODO initialize bitmask param? c.ManualLocation = c.bm.IsManualLocation() c.CanUpgrade = c.bm.CanUpgrade() c.Motd = c.bm.GetMotd() + c.HasTor = snowflake.HasTor() } defer statusMutex.Unlock() b, err := json.Marshal(c) |