Browse Source

update: complete VMess test

master
dnomd343 2 years ago
parent
commit
2c916b86eb
  1. 9
      Tester/V2ray.py
  2. 39
      Tester/VMess.py
  3. 2
      test.py

9
Tester/V2ray.py

@ -3,7 +3,6 @@
import copy
import itertools
from Basis.Functions import genFlag
from Basis.Methods import quicMethods
from Basis.Methods import udpObfuscations
@ -138,7 +137,7 @@ def h2Stream() -> dict:
'type': 'h2',
'host': settings['host'],
'path': path,
'secure': None, # HTTP/2 force enable tls
'secure': None, # HTTP/2 stream force enable tls
},
'server': {
'network': 'http',
@ -159,7 +158,7 @@ def quicStream(method: str, obfs: str) -> dict:
'method': method,
'passwd': passwd,
'obfs': obfs,
'secure': None, # QUIC force enable tls
'secure': None, # QUIC stream force enable tls
},
'server': {
'network': 'quic',
@ -213,10 +212,6 @@ def loadStream() -> list:
for isMulti in [False, True]:
addStream(grpcStream(isMulti)) # gRPC stream
addStream(addSecure(grpcStream(isMulti))) # gRPC stream with TLS
# for stream in streams:
# os.system('echo \'%s\' | jq .' % json.dumps(stream))
return streams

39
Tester/VMess.py

@ -21,9 +21,6 @@ settings = {
# 'serverBind': '::1',
# 'clientBind': '::1',
'workDir': '/tmp/ProxyC',
'host': '343.re',
'cert': '/etc/ssl/certs/343.re/fullchain.pem',
'key': '/etc/ssl/certs/343.re/privkey.pem',
}
@ -74,7 +71,7 @@ def loadTest(method: str, aid: int, stream: dict) -> dict:
}
configName = 'vmess_%s_%i_%s' % (method, aid, md5Sum(stream['caption'])[:8])
testInfo = { # release test info
'title': 'VMess test: security = %s | alterId = %i [%s]' % (method, aid, stream['caption']),
'title': 'VMess test: %s [security = %s | alterId = %i]' % (stream['caption'], method, aid),
'client': loadClient(configName + '_client.json', proxyInfo, socksInfo),
'server': loadServer(configName + '_server.json', proxyInfo, stream['server']),
'socks': socksInfo, # exposed socks5 address
@ -88,32 +85,8 @@ def loadTest(method: str, aid: int, stream: dict) -> dict:
def load():
stream = {
'caption': 'TCP stream (with tls)',
'info': {
'type': 'tcp',
'obfs': None,
'secure': {
'sni': settings['host'],
'alpn': None,
'verify': True,
},
},
'server': {
'network': 'tcp',
'tcpSettings': {},
'security': 'tls',
'tlsSettings': {
'alpn': ['h2', 'http/1.1'],
'certificates': [{
'certificateFile': settings['cert'],
'keyFile': settings['key'],
}]
}
}
}
# for method, aid in itertools.product(vmessMethods, [0, 64]):
# yield loadTest(method, aid, stream)
for stream in V2ray.loadStream():
yield loadTest('auto', 0, stream)
streams = V2ray.loadStream() # load v2ray-core stream list
for method, aid in itertools.product(vmessMethods, [0, 64]): # test every methods (and whether enable aead)
yield loadTest(method, aid, streams[0])
for stream in streams[1:]: # skip first stream that has benn checked
yield loadTest('auto', 0, stream) # aead with auto security

2
test.py

@ -99,5 +99,5 @@ vmess = VMess.load()
logging.critical('test start')
# runTest(ss, 64)
# runTest(ssr, 64)
runTest(vmess, 1)
runTest(vmess, 64)
logging.critical('test complete')

Loading…
Cancel
Save