Skip to content

Commit a1a244a

Browse files
committed
Update Version
1 parent 81de4f4 commit a1a244a

File tree

7 files changed

+32
-24
lines changed

7 files changed

+32
-24
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ V2ray/Xray多用户管理脚本,向导式管理[新增|删除|修改]传输协
5555
- MTProto
5656
- Shadowsocks
5757
- Quic
58-
- VLESS
58+
- VLESS_TCP
59+
- VLESS_TLS
5960
- VLESS_WS
6061
- VLESS_XTLS
6162
- Trojan

README_EN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ a tool to manage v2ray/xray config json, support multiple user && group manage
3636
- MTProto
3737
- Shadowsocks
3838
- Quic
39-
- VLESS
39+
- VLESS_TCP
40+
- VLESS_TLS
4041
- VLESS_WS
4142
- VLESS_XTLS
4243
- Trojan

v2ray

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# bash completion for v2ray/xray
22
function _auto_tab() {
33
local options_array=("start" "stop" "restart" "status" "update" "update.sh" "add" "del" "info" "port" "tls" "tfo" "stream" "iptables" "cdn" "stats" "clean" "log" "new" "rm" "-h" "-v" "help" "version")
4-
local add_array=("wechat" "utp" "srtp" "dtls" "wireguard" "socks" "mtproto" "ss" "vless" "vless_ws" "vless_xtls" "trojan" "ss" "quic" "h2" "tcp" "tcp_host" "ws")
4+
local add_array=("wechat" "utp" "srtp" "dtls" "wireguard" "socks" "mtproto" "ss" "vless_tcp" "vless_tls" "vless_ws" "vless_xtls" "trojan" "ss" "quic" "h2" "tcp" "tcp_host" "ws")
55
local log_array=("access" "a" "error" "e")
66
local cur prev
77

v2ray_util/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '3.9.1'
1+
__version__ = '3.9.2'
22

33
import sys
44
if "xray" in sys.argv[0]:

v2ray_util/config_modify/stream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def __init__(self, group_tag='A', group_index=-1):
2828
(StreamType.MTPROTO, "MTProto"),
2929
(StreamType.SS, "Shadowsocks"),
3030
(StreamType.QUIC, "Quic"),
31-
(StreamType.VLESS, "VLESS"),
31+
(StreamType.VLESS_TCP, "VLESS_TCP"),
32+
(StreamType.VLESS_TLS, "VLESS_TLS"),
3233
(StreamType.VLESS_WS, "VLESS_WS"),
3334
(StreamType.VLESS_XTLS, "VLESS_XTLS"),
3435
(StreamType.TROJAN, "Trojan"),
@@ -66,7 +67,7 @@ def select(self, sType):
6667
print("")
6768
header = CommonSelector(header_type_list(), _("please select fake header: ")).select()
6869
kw = {'security': security, 'key': key, 'header': header}
69-
elif sType in (StreamType.VLESS, StreamType.VLESS_WS, StreamType.VLESS_XTLS):
70+
elif sType in (StreamType.VLESS_TLS, StreamType.VLESS_WS, StreamType.VLESS_XTLS):
7071
port_set = all_port()
7172
if not "443" in port_set:
7273
print()

v2ray_util/util_core/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class StreamType(Enum):
6767
KCP_DTLS = 'dtls'
6868
KCP_WECHAT = 'wechat'
6969
KCP_WG = 'wireguard'
70-
VLESS = 'vless'
70+
VLESS_TCP = 'vless_tcp'
71+
VLESS_TLS = 'vless_tls'
7172
VLESS_WS = 'vless_ws'
7273
VLESS_XTLS = 'vless_xtls'
7374
TROJAN = 'trojan'

v2ray_util/util_core/writer.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ def write(self, **kw):
117117
elif self.part_json['protocol'] == 'socks':
118118
origin_protocol = StreamType.SOCKS
119119
elif self.part_json['protocol'] == 'vless':
120-
origin_protocol = StreamType.VLESS
120+
if self.part_json["streamSettings"]["security"] == "xtls":
121+
origin_protocol = StreamType.VLESS_XTLS
122+
elif self.part_json["streamSettings"]["security"] == "tls":
123+
origin_protocol = StreamType.VLESS_TLS
124+
else:
125+
origin_protocol = StreamType.VLESS_TCP
121126
elif self.part_json['protocol'] == 'trojan':
122127
origin_protocol = StreamType.TROJAN
123128

124-
if origin_protocol == StreamType.VLESS and self.part_json["streamSettings"]["security"] == "xtls":
125-
origin_protocol = StreamType.VLESS_XTLS
126-
127129
if origin_protocol != StreamType.MTPROTO and origin_protocol != StreamType.SS:
128130
security_backup = self.part_json["streamSettings"]["security"]
129131
if origin_protocol == StreamType.VLESS_XTLS:
@@ -138,7 +140,7 @@ def write(self, **kw):
138140
clean_mtproto_tag(self.config, self.group_index)
139141

140142
#原来是socks/mtproto/shadowsocks/vless/trojan/xtls协议 则先切换为标准的inbound
141-
if origin_protocol in (StreamType.MTPROTO, StreamType.SOCKS, StreamType.SS, StreamType.VLESS, StreamType.TROJAN, StreamType.VLESS_XTLS):
143+
if origin_protocol in (StreamType.MTPROTO, StreamType.SOCKS, StreamType.SS, StreamType.VLESS_TLS, StreamType.VLESS_TCP, StreamType.TROJAN, StreamType.VLESS_XTLS):
142144
vmess = self.load_template('server.json')
143145
vmess["inbounds"][0]["port"] = self.part_json["port"]
144146
if "allocate" in self.part_json:
@@ -213,7 +215,7 @@ def write(self, **kw):
213215
ws["wsSettings"]["headers"]["Host"] = kw['host']
214216
self.part_json["streamSettings"] = ws
215217

216-
elif self.stream_type in (StreamType.VLESS, StreamType.VLESS_XTLS, StreamType.VLESS_WS):
218+
elif self.stream_type in (StreamType.VLESS_TCP, StreamType.VLESS_TLS, StreamType.VLESS_XTLS, StreamType.VLESS_WS):
217219
vless = self.load_template('vless.json')
218220
vless["clients"][0]["id"] = str(uuid.uuid1())
219221
if self.stream_type == StreamType.VLESS_XTLS:
@@ -233,16 +235,17 @@ def write(self, **kw):
233235
self.save()
234236
alpn = ["http/1.1"]
235237
# tls的设置
236-
if not "certificates" in tls_settings_backup:
237-
from ..config_modify.tls import TLSModifier
238-
if self.stream_type == StreamType.VLESS_XTLS:
239-
tm = TLSModifier(self.group_tag, self.group_index, alpn=alpn, xtls=True)
240-
else:
241-
tm = TLSModifier(self.group_tag, self.group_index, alpn=alpn)
242-
tm.turn_on(False)
243-
return
244-
elif not "alpn" in tls_settings_backup:
245-
tls_settings_backup["alpn"] = alpn
238+
if self.stream_type != StreamType.VLESS_TCP:
239+
if not "certificates" in tls_settings_backup:
240+
from ..config_modify.tls import TLSModifier
241+
if self.stream_type == StreamType.VLESS_XTLS:
242+
tm = TLSModifier(self.group_tag, self.group_index, alpn=alpn, xtls=True)
243+
else:
244+
tm = TLSModifier(self.group_tag, self.group_index, alpn=alpn)
245+
tm.turn_on(False)
246+
return
247+
elif not "alpn" in tls_settings_backup:
248+
tls_settings_backup["alpn"] = alpn
246249

247250
elif self.stream_type == StreamType.TROJAN:
248251
self.part_json['protocol'] = "trojan"
@@ -296,7 +299,8 @@ def write(self, **kw):
296299
if domain:
297300
self.part_json["domain"] = domain
298301

299-
if origin_protocol in (StreamType.VLESS, StreamType.TROJAN, StreamType.VLESS_XTLS) and self.stream_type not in (StreamType.VLESS, StreamType.TROJAN, StreamType.VLESS_XTLS):
302+
apln_list = (StreamType.VLESS_TLS, StreamType.VLESS_TCP, StreamType.TROJAN, StreamType.VLESS_XTLS)
303+
if origin_protocol in apln_list and self.stream_type not in apln_list:
300304
if "alpn" in self.part_json["streamSettings"]["tlsSettings"]:
301305
del self.part_json["streamSettings"]["tlsSettings"]["alpn"]
302306

0 commit comments

Comments
 (0)