From 2d1c15c7bf5446432ef907118431d1f223da8f6a Mon Sep 17 00:00:00 2001 From: clore Date: Sun, 8 Sep 2024 22:00:57 +0000 Subject: [PATCH] force register_server requests to go throut IPv4 --- lib/init_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/init_server.py b/lib/init_server.py index 4312d0b..35d8f82 100644 --- a/lib/init_server.py +++ b/lib/init_server.py @@ -3,6 +3,7 @@ from lib import logging as logging_lib from lib import get_specs from lib import utils import threading +import socket import aiohttp import asyncio import json @@ -47,7 +48,9 @@ async def register_server(data): "Content-Type": "application/json" } - async with aiohttp.ClientSession() as session: + connector = aiohttp.TCPConnector(family=socket.AF_INET) + + async with aiohttp.ClientSession(connector=connector) as session: try: async with session.post(url, data=json_data, headers=headers, timeout=15) as response: if response.status == 200: