From 1146724dfc568369ae122c2de455c3864713503f Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Wed, 27 Jul 2022 22:38:06 +0200 Subject: [PATCH] CHANGE socket to IPv6 --- owrx/__main__.py | 4 +++- owrx/socket.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/owrx/__main__.py b/owrx/__main__.py index 1bf8f4b..1b18d28 100644 --- a/owrx/__main__.py +++ b/owrx/__main__.py @@ -18,11 +18,13 @@ from owrx.reporting import ReportingEngine from owrx.version import openwebrx_version from owrx.audio.queue import DecoderQueue from owrx.admin import add_admin_parser, run_admin_action +import socket import signal import argparse class ThreadedHttpServer(ThreadingMixIn, HTTPServer): + address_family = socket.AF_INET6 pass @@ -112,7 +114,7 @@ Support and info: https://groups.io/g/openwebrx Services.start() try: - server = ThreadedHttpServer(("0.0.0.0", coreConfig.get_web_port()), RequestHandler) + server = ThreadedHttpServer(("::", coreConfig.get_web_port()), RequestHandler) server.serve_forever() except SignalException: pass diff --git a/owrx/socket.py b/owrx/socket.py index 069a538..3e64560 100644 --- a/owrx/socket.py +++ b/owrx/socket.py @@ -2,7 +2,7 @@ import socket def getAvailablePort(): - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) s.bind(("", 0)) s.listen(1) port = s.getsockname()[1]