From e5a08a7a029e0269389e80cc1584a0761d459a73 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 1 Mar 2022 00:11:58 +0800 Subject: [PATCH] fix: test config of VLESS and Trojan --- ProxyTester/Xray.py | 7 ++++--- Test.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ProxyTester/Xray.py b/ProxyTester/Xray.py index 8c54bb8..5ad331c 100644 --- a/ProxyTester/Xray.py +++ b/ProxyTester/Xray.py @@ -27,7 +27,8 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict: 'client': { 'type': 'ws', 'host': host, - 'path': path + 'path': path, + 'secure': None }, 'server': { 'network': 'ws', @@ -45,7 +46,8 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict: 'type': 'ws', 'host': host, 'path': path, - 'ed': 2048 + 'ed': 2048, + 'secure': None }, 'server': { 'network': 'ws', @@ -58,7 +60,6 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict: } } - def addTlsConfig(rawStreamInfo: dict, cert: str, key: str, sni: str) -> dict: streamInfo = copy.deepcopy(rawStreamInfo) streamInfo['caption'] += ' (tls)' diff --git a/Test.py b/Test.py index fa103af..55fd20e 100644 --- a/Test.py +++ b/Test.py @@ -60,7 +60,10 @@ def testObject(option: dict) -> None: # test target object testDestroy(option['aider'], aiderProcess) raise Exception('check error') delay = checkResult['check']['http']['delay'] # get http delay - print(format(delay, '.2f') + 'ms') + if delay > 0: + print(format(delay, '.2f') + 'ms') + else: + print('ERROR') testDestroy(option['server'], serverProcess) # destroy server process if option['aider'] is not None: