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

39
Tester/VMess.py

@ -21,9 +21,6 @@ settings = {
# 'serverBind': '::1', # 'serverBind': '::1',
# 'clientBind': '::1', # 'clientBind': '::1',
'workDir': '/tmp/ProxyC', '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]) configName = 'vmess_%s_%i_%s' % (method, aid, md5Sum(stream['caption'])[:8])
testInfo = { # release test info 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), 'client': loadClient(configName + '_client.json', proxyInfo, socksInfo),
'server': loadServer(configName + '_server.json', proxyInfo, stream['server']), 'server': loadServer(configName + '_server.json', proxyInfo, stream['server']),
'socks': socksInfo, # exposed socks5 address 'socks': socksInfo, # exposed socks5 address
@ -88,32 +85,8 @@ def loadTest(method: str, aid: int, stream: dict) -> dict:
def load(): def load():
stream = { streams = V2ray.loadStream() # load v2ray-core stream list
'caption': 'TCP stream (with tls)', for method, aid in itertools.product(vmessMethods, [0, 64]): # test every methods (and whether enable aead)
'info': { yield loadTest(method, aid, streams[0])
'type': 'tcp', for stream in streams[1:]: # skip first stream that has benn checked
'obfs': None, yield loadTest('auto', 0, stream) # aead with auto security
'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)

2
test.py

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

Loading…
Cancel
Save