Toperlock / sing-box-subscribe

https://sing-box-subscribe-doraemon.vercel.app
1.94k stars 2.02k forks source link

vmess节点转换后,不能测延迟,选中节点也不通,无法翻出去,成死节点! #28

Closed caiysmy closed 11 months ago

caiysmy commented 12 months ago

首先感谢大佬开发的这个项目,让我完美的从clash过渡到singbox,大佬的这个项目,应该是目前最好用的转换工具了。但是我现在遇到一个问题,vmess节点转换后,测延迟没有数据,节点也不通,变成死节点。后来我发现了,是转换后是vmess节点配置里的"transport"下面多了3行多余的代码(分别是"path","headers","Host"),删除后,节点立刻正常了,可以测延迟,节点也通了。我把节点的clash订阅配置,和转换后的配置,还有修改后正常的配置上传上来,大佬你看看到底问题出在哪里,本人比较小白,不知道这样叙述,大佬是否明白。

clash订阅vmess配置: - { name: 台湾-优化, type: vmess, server: yes.cnmjcn.net, port: 16616, uuid:XXXXXXXXXXXXXXXXXXXXXXXXXX, alterId: 0, cipher: auto, udp: true, network: ws }

转换后的配置(我用的工具是V2.2.8): { "tag": "🇹🇼 💍台湾-优化", "type": "vmess", "server": "yes.cnmjcn.net", "server_port": 16616, "uuid": "XXXXXXXXXXXXXXXXXXXXXXXXXX", "security": "auto", "alter_id": 0, "packet_encoding": "xudp", "transport": { "type": "ws", "path": "", "headers": { "Host": "" } } }, 修改后正常的配置: { "tag": "🇹🇼 💍台湾-优化", "type": "vmess", "server": "yes.cnmjcn.net", "server_port": 16616, "uuid": "XXXXXXXXXXXXXXXXXXXXXXXX", "security": "auto", "alter_id": 0, "packet_encoding": "xudp", "transport": { "type": "ws" } },

Toperlock commented 12 months ago

现在加了判断条件,应该可以了

caiysmy commented 12 months ago

现在加了判断条件,应该可以了

谢谢大佬的辛勤付出,替换了大佬修改后的vmess.py,再次转换订阅,vmess节点已经正常了。大佬解决问题的速度杠杠的!!!

caiysmy commented 11 months ago

大佬,能不能教一下怎么把这个项目部署到cloudflare page,这个生成的链接,可以直连,我用部署到vercel的步骤照葫芦画瓢,总是不成功。只能把网页部署成了,但是python功能部分都不会弄,https://c44388e0.sing-box-subscribe-exl.pages.dev/这是我生成的连接,您帮我看看到底错在哪里了,谢谢了

Toperlock commented 11 months ago

cloudflare不支持python

caiysmy commented 11 months ago

大佬,电脑端用命令生成的congfig.json的路径能不能修改?我的想法是把路径改到singbox核心文件夹,直接覆盖旧的congfig.json

Toperlock commented 11 months ago

image

上面截图意思是保存在D:\singbox文件夹里

caiysmy commented 11 months ago

大佬,不会弄啊,是修改main.py里的save_config那部分吧,但是我python基础为0,真的无从下手。问了GPT,生成了根本运行不了,。你能在百忙中有时间能帮我改一下吗? 下面是你的源码,你帮我修改一下,行不,万分感谢 def save_config(path, nodes): if 'auto_backup' in providers and providers['auto_backup']: now = datetime.now().strftime('%Y%m%d%H%M%S') if os.path.exists(path): os.rename(path, f'{path}.{now}.bak') if os.path.exists(path): os.remove(path) print(f"已删除文件,并重新保存:\033[33m{path}\033[0m") print(f"File cấu hình đã được lưu vào: \033[33m{path}\033[0m") else: print(f"文件不存在,正在保存:\033[33m{path}\033[0m") print(f"File không tồn tại, đang lưu tại: \033[33m{path}\033[0m") tool.saveFile(path,json.dumps(nodes, indent=2, ensure_ascii=False))

Toperlock commented 11 months ago

main.py不要动。是修改providers.json文件。

{
    "subscribes":[
        {
            "url": "订阅地址",
            "tag": "机场1", 
            "enabled": true,
            "emoji": 1, 
            "prefix": "", 
            "User-Agent":"clashmeta" 
        },
        {
            "url": "订阅地址",
            "tag": "机场2",
            "enabled": false, 
            "emoji": 0,
            "prefix": "❤️机场前缀 - ",
            "User-Agent":"clashmeta"
        }
    ],
    "auto_set_outbounds_dns":{
        "proxy": "",
        "direct": ""
    },
    "save_config_path": "D:\/singbox\/config.json",
    "auto_backup": false,
    "exclude_protocol": "ssr",
    "config_template": "", 
    "Only-nodes": false
}
caiysmy commented 11 months ago

main.py不要动。是修改providers.json文件。

{
    "subscribes":[
        {
            "url": "订阅地址",
            "tag": "机场1", 
            "enabled": true,
            "emoji": 1, 
            "prefix": "", 
            "User-Agent":"clashmeta" 
        },
        {
            "url": "订阅地址",
            "tag": "机场2",
            "enabled": false, 
            "emoji": 0,
            "prefix": "❤️机场前缀 - ",
            "User-Agent":"clashmeta"
        }
    ],
    "auto_set_outbounds_dns":{
        "proxy": "",
        "direct": ""
    },
    "save_config_path": "D:\/singbox\/config.json",
    "auto_backup": false,
    "exclude_protocol": "ssr",
    "config_template": "", 
    "Only-nodes": false
}

谢谢大佬,已经好了,大佬技术很硬!!!