Skip to content

Commit

Permalink
update v3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Sep 21, 2019
1 parent aaef79c commit b159b10
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 297 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> v3.6.0
* Fixed: #218
* Fixed: v2ray重启失败时提示重启成功
* Fixed: 没有修改配置文件却触发v2ray重启
* Added: cdn 命令行传参(v2ray cdn)

> v3.5.2
* 支持80端口和443端口的cdn模式
* 支持域名按group存储
Expand Down
2 changes: 1 addition & 1 deletion v2ray_util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '3.5.2'
__version__ = '3.6.0'

from .util_core.trans import _
227 changes: 0 additions & 227 deletions v2ray_util/app.py

This file was deleted.

26 changes: 22 additions & 4 deletions v2ray_util/config_modify/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ..util_core.v2ray import restart
from ..util_core.group import Vmess, Socks, Mtproto, SS
from ..util_core.writer import ClientWriter, GroupWriter
from ..util_core.selector import ClientSelector, GroupSelector

@restart()
def alterid():
cs = ClientSelector(_('modify alterId'))
group = cs.group
Expand All @@ -19,11 +21,13 @@ def alterid():
cw = ClientWriter(group.tag, group.index, client_index)
cw.write_aid(int(new_alterid))
print(_("alterId modify success!"))
return True
else:
print(_("input error, please check is number"))
else:
print(_("only vmess protocol can modify alterId!"))

@restart()
def dyn_port():
gs = GroupSelector(_('modify dyn_port'))
group = gs.group
Expand All @@ -42,14 +46,17 @@ def dyn_port():
if (newAlterId.isdecimal()):
gw.write_dyp(True, newAlterId)
print(_("open dyn_port success!"))
return True
else:
print(_("input error, please check is number"))
elif choice == 'n':
gw.write_dyp(False)
print(_("close dyn_port success!"))
return True
else:
print(_("input error, please input again"))

@restart()
def new_email():
cs = ClientSelector(_('modify email'))
group = cs.group
Expand Down Expand Up @@ -88,7 +95,9 @@ def new_email():
cw = ClientWriter(group.tag, group.index, client_index)
cw.write_email(email)
print(_("modify email success!!"))
return True

@restart()
def new_uuid():
cs = ClientSelector(_('modify uuid'))
group = cs.group
Expand All @@ -107,11 +116,13 @@ def new_uuid():
cw = ClientWriter(group.tag, group.index, client_index)
cw.write_uuid(new_uuid)
print(_("UUID modify success!"))
return True
else:
print(_("undo modify"))
else:
print(_("only vmess protocol can modify uuid!"))

@restart(True)
def port():
gs = GroupSelector(_('modify port'))
group = gs.group
Expand All @@ -130,27 +141,34 @@ def port():
gw = GroupWriter(group.tag, group.index)
gw.write_port(new_port_info)
print(_('port modify success!'))
return True
else:
print(_("input error!"))

@restart()
def tfo():
gs = GroupSelector(_('modify tcpFastOpen'))
group = gs.group

if group == None:
exit(-1)
pass
else:
if type(group.node_list[0]) == Mtproto or type(group.node_list[0]) == SS:
print(_("V2ray MTProto/Shadowsocks don't support tcpFastOpen!!!"))
print("")
exit(-1)
return

print('{}: {}'.format(_("group tcpFastOpen"), group.tfo))
print("")
print(_("1.open TFO(force open)"))
print(_("2.close TFO(force close)"))
print(_("3.delete TFO(use system default profile)"))
choice = input(_("please select: "))
if not choice:
return
if not choice in ("1", "2", "3"):
print(_("input error, please input again"))
return

gw = GroupWriter(group.tag, group.index)
if choice == "1":
Expand All @@ -159,5 +177,5 @@ def tfo():
gw.write_tfo('off')
elif choice == "3":
gw.write_tfo('del')
else:
print(_("input error, please input again"))

return True
Loading

0 comments on commit b159b10

Please sign in to comment.