Browse Source

fix: command format of v2ray v5

dev
Dnomd343 2 years ago
parent
commit
ed122eec98
  1. 2
      Builder/VMess.py
  2. 4
      Tester/VMess.py

2
Builder/VMess.py

@ -26,4 +26,4 @@ def load(proxyInfo: dict, socksInfo: dict, configFile: str) -> tuple[list, str,
'streamSettings': V2ray.loadStream(proxyInfo['stream']) 'streamSettings': V2ray.loadStream(proxyInfo['stream'])
} }
vmessConfig = V2ray.loadConfig(socksInfo, outboundConfig) # load config file for v2ray-core vmessConfig = V2ray.loadConfig(socksInfo, outboundConfig) # load config file for v2ray-core
return ['v2ray', '-c', configFile], json.dumps(vmessConfig), {} # command, fileContent, envVar return ['v2ray', 'run', '-c', configFile], json.dumps(vmessConfig), {} # command, fileContent, envVar

4
Tester/VMess.py

@ -27,7 +27,7 @@ def loadServer(configFile: str, proxyInfo: dict, streamConfig: dict) -> Process:
'streamSettings': streamConfig 'streamSettings': streamConfig
}) })
serverFile = os.path.join(Settings['workDir'], configFile) serverFile = os.path.join(Settings['workDir'], configFile)
return Process(Settings['workDir'], cmd = ['v2ray', '-c', serverFile], file = { return Process(Settings['workDir'], cmd = ['v2ray', 'run', '-c', serverFile], file = {
'path': serverFile, 'path': serverFile,
'content': json.dumps(vmessConfig) 'content': json.dumps(vmessConfig)
}, env = { }, env = {
@ -75,7 +75,7 @@ def loadTest(method: str, aid: int, stream: dict) -> dict:
def load(): def load():
streams = V2ray.loadStream() # load v2ray-core stream list streams = V2ray.loadStream() # load v2ray-core stream list
for method, aid in itertools.product(vmessMethods, [0, 64]): # test every methods (and whether enable aead) for method, aid in itertools.product(vmessMethods, [0, 64]): # test every method (and whether enable aead)
yield loadTest(method, aid, streams[0]) yield loadTest(method, aid, streams[0])
for stream in streams[1:]: # skip first stream that has benn checked for stream in streams[1:]: # skip first stream that has benn checked
yield loadTest('auto', 0, stream) # aead with auto security yield loadTest('auto', 0, stream) # aead with auto security

Loading…
Cancel
Save