From 596ddfe08ee330e2ac03484e727e68c43c50fd9a Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 28 Feb 2022 15:31:45 +0800 Subject: [PATCH] fix: client secure as none for Tester --- ProxyTester/V2ray.py | 27 ++++++++++++++++++--------- demo.py | 36 +++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/ProxyTester/V2ray.py b/ProxyTester/V2ray.py index 8592818..edc41b3 100644 --- a/ProxyTester/V2ray.py +++ b/ProxyTester/V2ray.py @@ -59,7 +59,8 @@ def loadTcpStream(isObfs: bool, host: str, path: str) -> dict: return { 'caption': 'TCP', 'client': { - 'type': 'tcp' + 'type': 'tcp', + 'secure': None }, 'server': streamConfig } @@ -77,7 +78,8 @@ def loadTcpStream(isObfs: bool, host: str, path: str) -> dict: 'obfs': { 'host': host, 'path': path - } + }, + 'secure': None }, 'server': streamConfig } @@ -92,7 +94,8 @@ def loadKcpStream(seed: str, obfs: str) -> dict: 'client': { 'type': 'kcp', 'seed': seed, - 'obfs': obfs + 'obfs': obfs, + 'secure': None }, 'server': { 'network': 'kcp', @@ -113,7 +116,8 @@ def loadWsStream(host: str, path: str, isEd: bool) -> dict: 'client': { 'type': 'ws', 'host': host, - 'path': path + 'path': path, + 'secure': None }, 'server': { 'network': 'ws', @@ -128,7 +132,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', @@ -142,7 +147,8 @@ def loadH2Stream(host: str, path: str) -> dict: 'client': { 'type': 'h2', 'host': host, - 'path': path + 'path': path, + 'secure': None }, 'server': { 'network': 'http', @@ -160,7 +166,8 @@ def loadQuicStream(method: str, passwd: str, obfs: str) -> dict: 'type': 'quic', 'method': method, 'passwd': passwd, - 'obfs': obfs + 'obfs': obfs, + 'secure': None }, 'server': { 'network': 'quic', @@ -180,7 +187,8 @@ def loadGrpcStream(service: str, multiMode: bool = False) -> dict: 'caption': 'gRPC', 'client': { 'type': 'grpc', - 'service': service + 'service': service, + 'secure': None }, 'server': { 'network': 'grpc', @@ -194,7 +202,8 @@ def loadGrpcStream(service: str, multiMode: bool = False) -> dict: 'client': { 'type': 'grpc', 'service': service, - 'mode': 'multi' + 'mode': 'multi', + 'secure': None }, 'server': { 'network': 'grpc', diff --git a/demo.py b/demo.py index a3871f1..0ac6936 100644 --- a/demo.py +++ b/demo.py @@ -1,23 +1,25 @@ import ProxyDecoder as Decoder import ProxyFilter as Filter -info = { - 'type': 'vless', - 'server': '127.0.0.1', - 'port': 12345, - 'id': '1b1757d2-2ff1-4e8d-b62e-4e74c06f1325', - 'stream': { - 'type': 'grpc', - 'service': 'dnomd343' - } -} +# info = { +# 'type': 'vless', +# 'server': '127.0.0.1', +# 'port': 12345, +# 'id': '1b1757d2-2ff1-4e8d-b62e-4e74c06f1325', +# 'stream': { +# 'type': 'grpc', +# 'service': 'dnomd343' +# } +# } -ret = Filter.filte(info) +# ret = Filter.filte(info) +# print(ret) + +url = 'vmess://1b1757d2-2ff1-4e8d-b62e-4e74c06f1325@1.1.1.1:443' + +ret = Decoder.decode(url) print(ret) -# ret = Decoder.decode(url) -# print(ret) -# -# status, ret = Filter.filte(ret, isExtra = True) -# print(status) -# print(ret) +status, ret = Filter.filte(ret, isExtra = True) +print(status) +print(ret)