mirror of
https://github.com/onionshare/onionshare.git
synced 2025-10-11 04:38:43 -04:00
Merge branch 'censorship_default_route' of https://github.com/mig5/onionshare into mig5-censorship_default_route
This commit is contained in:
commit
15eda5ed04
2 changed files with 69 additions and 48 deletions
|
@ -181,12 +181,9 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||
self.tor_con.start(self.curr_settings)
|
||||
|
||||
def _got_no_bridges(self):
|
||||
self.common.log(
|
||||
"AutoConnectTab",
|
||||
"_got_no_bridges",
|
||||
"Could not obtain bridges, so falling back to trying built-in obfs4 bridges",
|
||||
)
|
||||
# If we got no bridges, try connecting again using built-in obfs4 bridges
|
||||
# If we got no bridges, even after trying the default bridges
|
||||
# provided by the Censorship API, try connecting again using
|
||||
# our built-in obfs4 bridges
|
||||
self.curr_settings.set("bridges_type", "built-in")
|
||||
self.curr_settings.set("bridges_builtin_pt", "obfs4")
|
||||
self.curr_settings.set("bridges_enabled", True)
|
||||
|
@ -249,6 +246,18 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||
bridge_settings = self.censorship_circumvention.request_settings(
|
||||
country=country
|
||||
)
|
||||
|
||||
if not bridge_settings:
|
||||
# Fall back to trying the default bridges from the API
|
||||
self.common.log(
|
||||
"AutoConnectTab",
|
||||
"use_bridge_connect_clicked",
|
||||
"Falling back to trying default bridges provided by the Censorship Circumvention API",
|
||||
)
|
||||
bridge_settings = (
|
||||
self.censorship_circumvention.request_default_bridges()
|
||||
)
|
||||
|
||||
self.common.gui.meek.cleanup()
|
||||
|
||||
if bridge_settings and self.censorship_circumvention.save_settings(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue