From da973878a8db681541556fbcab6a10421567e935 Mon Sep 17 00:00:00 2001 From: Pablo Iglesias Date: Mon, 8 Apr 2024 23:47:24 +0200 Subject: [PATCH 1/2] Added fix for asus rog ally on windows to prevent an error related with websockets connection --- css_browserhook.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/css_browserhook.py b/css_browserhook.py index c945536..7e4219f 100644 --- a/css_browserhook.py +++ b/css_browserhook.py @@ -1,6 +1,6 @@ import os, re, uuid, asyncio, json, aiohttp, time from typing import List -from css_utils import get_theme_path, Log, Result +from css_utils import get_theme_path, Log, Result, PLATFORM_WIN import css_inject MAX_QUEUE_SIZE = 500 @@ -414,7 +414,11 @@ async def health_check(self): while True: await asyncio.sleep(3) try: - async with aiohttp.ClientSession() as web: + if PLATFORM_WIN: + trust_env = True + else: + trust_env = False + async with aiohttp.ClientSession(trust_env=trust_env) as web: res = await web.get(f"http://127.0.0.1:8080/json/version", timeout=3) if (res.status != 200): From 76ed57e7d438977cd65169f4b2f028c147e9cfa3 Mon Sep 17 00:00:00 2001 From: Pablo Iglesias Date: Tue, 9 Apr 2024 00:01:16 +0200 Subject: [PATCH 2/2] refactor code to use PLATFORM_WIN --- css_browserhook.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/css_browserhook.py b/css_browserhook.py index 7e4219f..eb4615d 100644 --- a/css_browserhook.py +++ b/css_browserhook.py @@ -414,11 +414,7 @@ async def health_check(self): while True: await asyncio.sleep(3) try: - if PLATFORM_WIN: - trust_env = True - else: - trust_env = False - async with aiohttp.ClientSession(trust_env=trust_env) as web: + async with aiohttp.ClientSession(trust_env=PLATFORM_WIN) as web: res = await web.get(f"http://127.0.0.1:8080/json/version", timeout=3) if (res.status != 200):