Exemplo n.º 1
0
    import server_info
    choice=input("请输入要改动态端口的节点Group字母:")
    choice=choice.upper()

if length == 1 or (len(choice)==1 and re.match(r'[A-Z]', choice) and choice <= mul_user_conf[-1]['indexDict']['group']):

    for sin_user_conf in mul_user_conf:
        if sin_user_conf['indexDict']['group'] == choice:
            index_dict = sin_user_conf['indexDict']
            print ("当前组动态端口状态:%s\n" % str(sin_user_conf['dyp'])) 
            break

    dp=input("是否开启动态端口(y/n)")

    if dp == 'y' or dp == 'Y':
        newAlterId=input("请为动态端口设置alterID(默认32): ")
        if newAlterId == '':
            newAlterId='32'
        if (not v2ray_util.is_number(newAlterId)):
            print ("\n输入错误,请检查是否为数字")
        else:
            write_json.en_dyn_port(1, index_dict, newAlterId)
            print("\n成功开启动态端口!")
    elif dp == 'n' or dp == 'N':
        write_json.en_dyn_port(0, index_dict)
        print("\n成功关闭动态端口!")
    else:
        print ("\n输入错误,请检查重新输入")
else:
    print("输入有误,请检查是否为字母且范围中")
Exemplo n.º 2
0
                  str(sin_user_conf["net"] + " " + sin_user_conf["type"]))
            break

    print("")
    #选择新的传输方式
    print("请选择新的传输方式:")
    print("1.普通TCP")
    print("2.HTTP伪装")
    print("3.WebSocket流量")
    print("4.普通mKCP")
    print("5.mKCP + srtp")
    print("6.mKCP + utp")
    print("7.mKCP + wechat-video")
    print("8.mKCP + dtls")
    print("9.HTTP/2")

    new_stream_network = input()

    if not v2ray_util.is_number(new_stream_network):
        print("请输入数字!")
        exit
    else:
        new_stream_network = int(new_stream_network)
        if new_stream_network > 0 and new_stream_network < 10:
            v2ray_util.choice_stream(new_stream_network, index_dict)
            print("传输模式修改成功!")
        else:
            print("请输入有效数字!")
            exit
else:
    print("输入有误,请检查是否为字母且范围中")
Exemplo n.º 3
0
with open('/usr/local/v2ray.fun/json_template/client.json',
          'r') as client_json_file:
    client_config = json.load(client_json_file)

#打开服务器端配置文件
with open('/etc/v2ray/config.json', 'r') as json_file:
    config = json.load(json_file)

mul_user_conf = read_json.multiUserConf

user_index = 0

if len(mul_user_conf) > 1:
    import server_info
    choice = input("请输入要生成客户端json的节点序号:")
    if v2ray_util.is_number(
            choice) and choice > 0 and choice <= len(mul_user_conf):
        user_index = choice - 1
    else:
        print("输入错误,请检查是否为数字和范围中")

#使用服务端配置来修改客户端模板
index_dict = mul_user_conf[user_index]['indexDict']
if index_dict['inboundOrDetour'] == 0:
    part_json = config[u"inbound"]
else:
    detour_index = index_dict['detourIndex']
    part_json = config[u"inboundDetour"][detour_index]

client_config[u"outbound"][u"settings"][u"vnext"][0][u"port"] = mul_user_conf[
    user_index]['port']
client_config[u"outbound"][u"settings"][u"vnext"][0][u"users"][0][
Exemplo n.º 4
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import read_json
import write_json
from base_util import v2ray_util

mul_user_conf = read_json.multiUserConf

length = len(mul_user_conf)

choice = 1

if length > 1:
    import server_info
    choice = input("请输入要删除的user节点序号数字:")
    if not v2ray_util.is_number(choice):
        print("输入错误,请检查是否为数字")
        exit
    choice = int(choice)

if length == 1 or (choice > 0 and choice <= len(mul_user_conf)):
    print("你选择的user信息:")
    print(mul_user_conf[choice - 1])
    schoice = input("是否删除y/n:")
    if schoice == 'y' or schoice == 'Y':
        write_json.del_user(choice - 1)
    else:
        print("撤销删除")
else:
    print("输入错误,请检查是否符合范围中")
Exemplo n.º 5
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import read_json
import write_json
from base_util import v2ray_util

mul_user_conf = read_json.multiUserConf

length = len(mul_user_conf)

choice = 1

if length > 1:
    import server_info
    choice=input("请输入要改alterId的节点序号数字:")
    if not v2ray_util.is_number(choice):
        print("输入错误,请检查是否为数字")
        exit
    choice = int(choice)

if length == 1 or (choice > 0 and choice <= length):
    new_alterid=input("请输入新的alterID: ")
    if (v2ray_util.is_number(new_alterid)):
        write_json.write_alterid(new_alterid, mul_user_conf[choice - 1]['indexDict'])
        print("alterID修改成功!")
    else:
        print ("输入错误,请检查是否为数字")
else:
    print ("输入错误,请检查是否符合范围中")
Exemplo n.º 6
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import write_json
from base_util import v2ray_util

new_port = input("请输入新端口:")
if v2ray_util.is_number(new_port):
    write_json.create_new_port(new_port)
else:
    print("\n输入错误,请检查是否为数字")
Exemplo n.º 7
0
from base_util import v2ray_util

mul_user_conf = read_json.multiUserConf

length = len(mul_user_conf)

choice = 'A'

if length > 1:
    import server_info
    choice = input("请输入要改port的节点Group字母:")
    choice = choice.upper()

if length == 1 or (len(choice) == 1 and re.match(r'[A-Z]', choice)
                   and choice <= mul_user_conf[-1]['indexDict']['group']):
    for sin_user_conf in mul_user_conf:
        if sin_user_conf['indexDict']['group'] == choice:
            index_dict = sin_user_conf['indexDict']
            print("当前组的端口为:%s" % str(sin_user_conf['port']))
            break

    print("请输入新端口:")
    new_port = input()
    if (v2ray_util.is_number(new_port)):
        write_json.write_port(new_port, index_dict)
        print('端口修改成功!')
    else:
        print("输入错误,请检查是否为数字")
else:
    print("输入有误,请检查是否为字母且范围中")