From 94ea9a1e2aba2d5536b7212327aaef5ab1dcd495 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 28 Feb 2022 15:08:54 +0800 Subject: [PATCH] fix: VLESS and Trojan use TLS secure in default --- ProxyFilter/Xray.py | 8 ++++++++ demo.py | 22 +++++++++++++++++----- docs/ProxyObject.md | 24 ++++++++++++------------ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/ProxyFilter/Xray.py b/ProxyFilter/Xray.py index f05bbd1..55ea4eb 100644 --- a/ProxyFilter/Xray.py +++ b/ProxyFilter/Xray.py @@ -14,6 +14,7 @@ xrayFlowList = [ xrayStreamRules = copy.deepcopy(V2ray.v2rayStreamRules) xrayStreamRules.pop('secureObject') + xrayStreamRules['tcpObject']['secure']['type'] = ['tlsObject', 'xtlsObject'] xrayStreamRules['kcpObject']['secure']['type'] = ['tlsObject', 'xtlsObject'] xrayStreamRules['wsObject']['secure']['type'] = 'tlsObject' @@ -21,6 +22,13 @@ xrayStreamRules['h2Object']['secure']['type'] = 'tlsObject' xrayStreamRules['quicObject']['secure']['type'] = 'tlsObject' xrayStreamRules['grpcObject']['secure']['type'] = 'tlsObject' +xrayStreamRules['tcpObject']['secure']['default'] = {'type': 'tls'} +xrayStreamRules['kcpObject']['secure']['default'] = {'type': 'tls'} +xrayStreamRules['wsObject']['secure']['default'] = {'type': 'tls'} +xrayStreamRules['h2Object']['secure']['default'] = {'type': 'tls'} +xrayStreamRules['quicObject']['secure']['default'] = {'type': 'tls'} +xrayStreamRules['grpcObject']['secure']['default'] = {'type': 'tls'} + xrayStreamRules['tlsObject'] = { 'type': { 'optional': True, diff --git a/demo.py b/demo.py index 18d6bf4..a3871f1 100644 --- a/demo.py +++ b/demo.py @@ -1,11 +1,23 @@ import ProxyDecoder as Decoder import ProxyFilter as Filter -url = '...' +info = { + 'type': 'vless', + 'server': '127.0.0.1', + 'port': 12345, + 'id': '1b1757d2-2ff1-4e8d-b62e-4e74c06f1325', + 'stream': { + 'type': 'grpc', + 'service': 'dnomd343' + } +} -ret = Decoder.decode(url) +ret = Filter.filte(info) print(ret) -status, ret = Filter.filte(ret, isExtra = True) -print(status) -print(ret) +# ret = Decoder.decode(url) +# print(ret) +# +# status, ret = Filter.filte(ret, isExtra = True) +# print(status) +# print(ret) diff --git a/docs/ProxyObject.md b/docs/ProxyObject.md index 0f47e81..407170a 100644 --- a/docs/ProxyObject.md +++ b/docs/ProxyObject.md @@ -589,7 +589,7 @@ + 类型:*None* / *tlsObject* / *xtlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### kcpObject @@ -621,7 +621,7 @@ + 类型:*None* / *tlsObject* / *xtlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### wsObject @@ -664,7 +664,7 @@ + 类型:*None* / *tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### h2Object @@ -698,7 +698,7 @@ + 类型:*tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### quicObject @@ -738,7 +738,7 @@ + 类型:*tlsObject* + 说明:TLS加密 -+ 缺省:secureObject ++ 缺省:tlsObject + 可选值:不限 ### grpcObject @@ -772,7 +772,7 @@ + 类型:*None* / *tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### obfsObject @@ -956,7 +956,7 @@ + 类型:*None* / *tlsObject* / *xtlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### kcpObject @@ -988,7 +988,7 @@ + 类型:*None* / *tlsObject* / *xtlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### wsObject @@ -1031,7 +1031,7 @@ + 类型:*None* / *tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### h2Object @@ -1065,7 +1065,7 @@ + 类型:*tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### quicObject @@ -1105,7 +1105,7 @@ + 类型:*tlsObject* + 说明:TLS加密 -+ 缺省:secureObject ++ 缺省:tlsObject + 可选值:不限 ### grpcObject @@ -1139,7 +1139,7 @@ + 类型:*None* / *tlsObject* + 说明:TLS加密 -+ 缺省:None ++ 缺省:tlsObject + 可选值:不限 ### obfsObject