From 5e71367c215772a3dccfb345c04bb8c94a97e549 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Fri, 18 Oct 2024 15:08:20 +0200 Subject: [PATCH] Fix websocket url in docker container. --- basicswap/bin/run.py | 1 + basicswap/http_server.py | 2 +- basicswap/templates/header.html | 18 +++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/basicswap/bin/run.py b/basicswap/bin/run.py index f5e5dc1..65baf4f 100755 --- a/basicswap/bin/run.py +++ b/basicswap/bin/run.py @@ -312,6 +312,7 @@ def runClient(fp, data_dir, chain, start_only_coins): swap_client.log.info(f'Starting ws server at {ws_url}.') swap_client.ws_server = WebsocketServer(host=settings['wshost'], port=settings['wsport']) + swap_client.ws_server.client_port = settings.get('wsclientport', settings['wsport']) swap_client.ws_server.set_fn_new_client(ws_new_client) swap_client.ws_server.set_fn_client_left(ws_client_left) swap_client.ws_server.set_fn_message_received(ws_message_received) diff --git a/basicswap/http_server.py b/basicswap/http_server.py index 243c940..7ce3cac 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -135,7 +135,7 @@ class HttpHandler(BaseHTTPRequestHandler): def render_template(self, template, args_dict, status_code=200, version=__version__): swap_client = self.server.swap_client if swap_client.ws_server: - args_dict['ws_url'] = swap_client.ws_server.url + args_dict['ws_port'] = swap_client.ws_server.client_port if swap_client.debug: args_dict['debug_mode'] = True if swap_client.debug_ui: diff --git a/basicswap/templates/header.html b/basicswap/templates/header.html index 377a7cb..33ab064 100644 --- a/basicswap/templates/header.html +++ b/basicswap/templates/header.html @@ -97,7 +97,7 @@ document.addEventListener('DOMContentLoaded', function() { function updateShutdownButtons() { const activeSwaps = parseInt(shutdownButtons[0].getAttribute('data-active-swaps') || '0'); - + shutdownButtons.forEach(button => { if (activeSwaps > 0) { button.classList.add('shutdown-disabled'); @@ -199,7 +199,7 @@ document.addEventListener('DOMContentLoaded', function() {
  • Change/Set Password {{ change_password_svg | safe }} Change/Set Password -
  • + {% if debug_mode == true %}
  • RPC @@ -242,14 +242,14 @@ document.addEventListener('DOMContentLoaded', function() { {% endif %} - +
  • {% endif %} - + {% if encrypted == true %}
    - {{ shutdown_svg | safe }} @@ -611,7 +611,7 @@ document.addEventListener('DOMContentLoaded', function() { - {% if ws_url %} + {% if ws_port %}