From b928cfc0d5ac8c846045d398075942adf17d63d2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 28 Mar 2024 16:48:01 +0200 Subject: [PATCH] add ipv6 support to openBrowser method #263 --- src/util/helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/helper.py b/src/util/helper.py index af65f727..8c7c6fff 100644 --- a/src/util/helper.py +++ b/src/util/helper.py @@ -325,7 +325,10 @@ def openBrowser(agent): if agent and agent != "False": print(f"Opening browser: {agent}...") ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1" - url = f'http://{ui_ip}:{config.ui_port}/{config.homepage}' + if ':' in ui_ip: # IPv6 + url = f'http://[{ui_ip}]:{config.ui_port}/{config.homepage}' + else: # IPv4 + url = f'http://{ui_ip}:{config.ui_port}/{config.homepage}' try: import subprocess return subprocess.Popen([config.open_browser, url])