Browse Source

fix: test config of VLESS and Trojan

master
Dnomd343 3 years ago
parent
commit
e5a08a7a02
  1. 7
      ProxyTester/Xray.py
  2. 3
      Test.py

7
ProxyTester/Xray.py

@ -27,7 +27,8 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict:
'client': { 'client': {
'type': 'ws', 'type': 'ws',
'host': host, 'host': host,
'path': path 'path': path,
'secure': None
}, },
'server': { 'server': {
'network': 'ws', 'network': 'ws',
@ -45,7 +46,8 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict:
'type': 'ws', 'type': 'ws',
'host': host, 'host': host,
'path': path, 'path': path,
'ed': 2048 'ed': 2048,
'secure': None
}, },
'server': { 'server': {
'network': 'ws', '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: def addTlsConfig(rawStreamInfo: dict, cert: str, key: str, sni: str) -> dict:
streamInfo = copy.deepcopy(rawStreamInfo) streamInfo = copy.deepcopy(rawStreamInfo)
streamInfo['caption'] += ' (tls)' streamInfo['caption'] += ' (tls)'

3
Test.py

@ -60,7 +60,10 @@ def testObject(option: dict) -> None: # test target object
testDestroy(option['aider'], aiderProcess) testDestroy(option['aider'], aiderProcess)
raise Exception('check error') raise Exception('check error')
delay = checkResult['check']['http']['delay'] # get http delay delay = checkResult['check']['http']['delay'] # get http delay
if delay > 0:
print(format(delay, '.2f') + 'ms') print(format(delay, '.2f') + 'ms')
else:
print('ERROR')
testDestroy(option['server'], serverProcess) # destroy server process testDestroy(option['server'], serverProcess) # destroy server process
if option['aider'] is not None: if option['aider'] is not None:

Loading…
Cancel
Save