diff --git a/basicswap/http_server.py b/basicswap/http_server.py index d9ff918..48d85ec 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -45,7 +45,7 @@ from .ui.page_automation import ( ) from .ui.page_bids import page_bids, page_bid from .ui.page_offers import page_offers, page_offer, page_newoffer -from .ui.page_tor import page_tor +from .ui.page_tor import page_tor, get_tor_established_state from .ui.page_wallet import page_wallets, page_wallet @@ -107,6 +107,15 @@ class HttpHandler(BaseHTTPRequestHandler): args_dict['debug_mode'] = True if swap_client.debug_ui: args_dict['debug_ui_mode'] = True + if swap_client.use_tor_proxy: + args_dict['use_tor_proxy'] = True + # TODO: Cache value? + try: + args_dict['tor_established'] = True if get_tor_established_state(swap_client) == '1' else False + except Exception: + if swap_client.debug: + swap_client.log.error(traceback.format_exc()) + return bytes(template.render( title=self.server.title, h2=self.server.title, diff --git a/basicswap/templates/header.html b/basicswap/templates/header.html index dd4182d..3c5d733 100644 --- a/basicswap/templates/header.html +++ b/basicswap/templates/header.html @@ -19,6 +19,9 @@ {% if debug_ui_mode == true %}
Debug UI mode: Active
{% endif %} +{% if use_tor_proxy == true %} +Tor mode: Active{% if tor_established == true %}, Connected{% endif %}
+{% endif %} {% if ws_url %}