summaryrefslogtreecommitdiff
path: root/pkg/backend
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-30 22:26:07 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-30 22:26:07 +0100
commitf08898257dbc46134520ff4cd68308240543325e (patch)
tree5f30fb8b607f02fc7e946656c0cfbb00f3e68526 /pkg/backend
parentde4534db33835783609fb002131fd80339f532a5 (diff)
[bug] avoid location corner case
Diffstat (limited to 'pkg/backend')
-rw-r--r--pkg/backend/api.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index 52c23c3..ba07adf 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -86,6 +86,13 @@ func SetTransport(label string) {
log.Println(err)
}
if label == "obfs4" {
+ // XXX this is an expedite way of avoiding the corner case
+ // in which user has selected a manual location that does not offer bridges.
+ // In the future, we can be more delicate and 1. do the switch only if the manual location
+ // is incompatible with obfs4; 2. notify the user of the change.
+ // But tonight we're in problem-solving mode, and we can assume that user wants to use bridges,
+ // no matter what. So let's assume that "use obfs4" supersedes everything else and be done.
+ UseAutomaticGateway()
ctx.cfg.SetUseObfs4(true)
} else {
ctx.cfg.SetUseObfs4(false)