Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sing-box core 非自定义配置测试(五) #3827

Closed
2dust opened this issue May 7, 2023 · 24 comments
Closed

sing-box core 非自定义配置测试(五) #3827

2dust opened this issue May 7, 2023 · 24 comments

Comments

@2dust
Copy link
Owner

2dust commented May 7, 2023

所有v2ray core支持的协议,非自定义配置现在可以生成 sing-box 的配置文件了

测试方式

  • 下载x64包 v2rayN.zip

  • 运行,配置文件的core类型选择sing-box

  • 测试是否可用;如有问题,请先自行查看guiConfigs/config.json是否正确的sing-box配置

  • 发现问题请反馈

注意

  • Tun模式目前支持了sing-box配置,tun模式时只会开启一个sing-box core;
  • 路由高级规则中增加进程名(Tun 模式生效)
  • sing-box的DNS设置中增加Tun DNS
  • 移除tun 设置的进程名和DNS和IP等设置
@2dust
Copy link
Owner Author

2dust commented May 7, 2023

之前的测试issue
#3753
#3770
#3781
#3808

@chika0801
Copy link
Contributor

这个版本应该能候选了吧(2333)明天找时间测测。

@uuiid
Copy link

uuiid commented May 8, 2023

#3808 (comment) 这个是说在使用vmess协议时, 传输方式为tls时, 出站中 els配置中server_name子段需要填写伪装域名, 作者你这里就算时界面上有, 写出子段也是空的

@2dust
Copy link
Owner Author

2dust commented May 8, 2023

#3808 (comment) 这个是说在使用vmess协议时, 传输方式为tls时, 出站中 els配置中server_name子段需要填写伪装域名, 作者你这里就算时界面上有, 写出子段也是空的

server_name 对应界面上的SNI,伪装域名是v2ray的说法

@chika0801
Copy link
Contributor

刚看到singbox群里说的内容是

"system dns" 在 tun 下会发向 tun 网卡的 dns 地址,肯定是会回环,要达到类似 system dns 的效果可以编译 with_dhcp 用 dhcp://auto

关闭 strict_route 会漏 dns,漏给其他网卡解析了

也许以前的那些莫名现象和这个点有关。

链接 https://t.me/yapug/20827

@uuiid
Copy link

uuiid commented May 9, 2023

#3808(评论)这个是说在使用vmess协议时,传输方式为tls时,出站中els配置中server_name子段需要填写伪装域名称,作者你这里算时代面上有,写出子段也是空的

server_name 对应用界面上的SNI,伪装域名称是v2ray的说法

谢谢,懂了,ヾ(•ω•`)o 我这主要是看解析订阅的条目, 然后进行转换的, 说法可能不准确, 准确来讲是 v2ray的订阅中, 如果订阅中有tls. 那么,相应的sing-box中tls子段中的server_name应该是订阅中的host,
但是测试中也发现了问题, 在协议伟 vmess是, 开启了tls后无法连接

@2dust
Copy link
Owner Author

2dust commented May 9, 2023

刚看到singbox群里说的内容是

"system dns" 在 tun 下会发向 tun 网卡的 dns 地址,肯定是会回环,要达到类似 system dns 的效果可以编译 with_dhcp 用 dhcp://auto

关闭 strict_route 会漏 dns,漏给其他网卡解析了

也许以前的那些莫名现象和这个点有关。

链接 https://t.me/yapug/20827

如果编译没有dhcp的情况下,是关闭/开启 strict_route 正确?

@2dust
Copy link
Owner Author

2dust commented May 9, 2023

#3808(评论)这个是说在使用vmess协议时,传输方式为tls时,出站中els配置中server_name子段需要填写伪装域名称,作者你这里算时代面上有,写出子段也是空的

server_name 对应用界面上的SNI,伪装域名称是v2ray的说法

谢谢,懂了,ヾ(•ω•`)o 我这主要是看解析订阅的条目, 然后进行转换的, 说法可能不准确, 准确来讲是 v2ray的订阅中, 如果订阅中有tls. 那么,相应的sing-box中tls子段中的server_name应该是订阅中的host, 但是测试中也发现了问题, 在协议伟 vmess是, 开启了tls后无法连接

把你的vmess分享下,可以改到域名和ip?
sing-box文档上写了如果address是域名,tls server_name 可以不填

@uuiid
Copy link

uuiid commented May 9, 2023

#3808(评论)这个是说在使用vmess协议时,传输方式为tls时,出站中els配置中server_name子段需要填写伪装域名称,作者你这里算时代面上有,写出子段也是空的

server_name 对应用界面上的SNI,伪装域名称是v2ray的说法

谢谢,懂了,ヾ(•ω•`)o 我这主要是看解析订阅的条目, 然后进行转换的, 说法可能不准确, 准确来讲是 v2ray的订阅中, 如果订阅中有tls. 那么,相应的sing-box中tls子段中的server_name应该是订阅中的host, 但是测试中也发现了问题, 在协议伟 vmess是, 开启了tls后无法连接

把你的vmess分享下,可以改到域名和ip? sing-box文档上写了如果address是域名,tls server_name 可以不填

pokemon
这个是我的配置,

{
  "log": {
    "level": "info",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "tag": "remote",
        "address": "tcp://8.8.8.8",
        "detour": "proxy"
      },
      {
        "tag": "local",
        "address": "223.5.5.5",
        "detour": "direct"
      },
      {
        "tag": "block",
        "address": "rcode://success"
      },
      {
        "tag": "local_local",
        "address": "223.5.5.5",
        "detour": "direct"
      }
    ],
    "rules": [
      {
        "server": "local",
        "geosite": [
          "cn"
        ]
      },
      {
        "server": "block",
        "geosite": [
          "category-ads-all"
        ]
      },
      {
        "server": "local_local",
        "domain": [
          "in03.my1188.org"
        ]
      }
    ]
  },
  "inbounds": [
    {
      "type": "socks",
      "tag": "socks",
      "listen": "127.0.0.1",
      "listen_port": 10810,
      "domain_strategy": "ipv4_only",
      "sniff": true,
      "sniff_override_destination": true
    },
    {
      "type": "http",
      "tag": "http",
      "listen": "127.0.0.1",
      "listen_port": 10811,
      "domain_strategy": "ipv4_only",
      "sniff": true,
      "sniff_override_destination": true
    }
  ],
  "outbounds": [
    {
      "type": "vmess",
      "tag": "proxy",
      "server": "",
      "server_port": 63078,
      "uuid": "",
      "security": "auto",
      "alter_id": 0,
      "tls": {
        "enabled": true,
        "server_name": "",
        "insecure": false
      },
      "transport": {
        "type": "ws",
        "path": "/"
      }
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    }
  ],
  "route": {
    "rules": [
      {
        "outbound": "direct",
        "domain": [
          "example-example.com",
          "example-example2.com"
        ],
        "domain_suffix": [
          ".example-example.com",
          ".example-example2.com"
        ]
      },
      {
        "outbound": "block",
        "geosite": [
          "category-ads-all"
        ]
      },
      {
        "outbound": "direct",
        "geosite": [
          "cn"
        ]
      },
      {
        "outbound": "direct",
        "geoip": [
          "private",
          "cn"
        ]
      }
    ]
  }
}

我已经去除了 server 子段, 这个配置中的 server 子段是地址不是 ip

@2dust
Copy link
Owner Author

2dust commented May 9, 2023

@uuiid
问题应该在这里,没有生成 host

 "transport": {
        "type": "ws",
        "path": "/"
      }

在sing-box的文档中没有找到详细的说明,等有空查代码

@uuiid
Copy link

uuiid commented May 9, 2023

@uuiid 问题应该在这里,没有生成 host

 "transport": {
        "type": "ws",
        "path": "/"
      }

在sing-box的文档中没有找到详细的说明,等有空查代码

没错,这里也有问题, 这里也要填
大概是这样的

    {
      "alter_id": 0,
      "network": "tcp",
      "security": "auto",
      "server": "",
      "server_port": 63088,
      "tag": "V1-台湾多台负载均衡中继B1.5x",
      "tls": {
        "disable_sni": false,
        "enabled": true,
        "insecure": false,
        "server_name": "填订阅中的host",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        }
      },
      "transport": {
        "headers": {
          "Host": "填订阅中的host"
        },
        "path": "/mugua",
        "type": "ws"
      },
      "type": "vmess",
      "uuid": ""
    }

这个是我自己在看他代码理解后填的, 测试后有的可以用

@2dust
Copy link
Owner Author

2dust commented May 9, 2023

v2rayN.zip

  • 增加了sing-box流量统计和速率显示
  • ws中增加headers host

@uuiid 测试下ws

@chika0801
Copy link
Contributor

chika0801 commented May 9, 2023

刚看到singbox群里说的内容是
"system dns" 在 tun 下会发向 tun 网卡的 dns 地址,肯定是会回环,要达到类似 system dns 的效果可以编译 with_dhcp 用 dhcp://auto
关闭 strict_route 会漏 dns,漏给其他网卡解析了
也许以前的那些莫名现象和这个点有关。
链接 https://t.me/yapug/20827

如果编译没有dhcp的情况下,是关闭/开启 strict_route 正确?

我理解的是 你把 strict_route 默认给 false

按它话的意思是因为如果是 true ,要用原本非tun模式时网卡的默认DNS地址比如192.168.1.1(网关IP),要用编译有 tag with_dhcp 的sing-box.exe,问题是githhub下载的我记得是默认没编译这个tag的。

还有就是反正你换了Singbox出站直连服务端了嘛(无论我们还遇得到sing-box莫名CPU占用之类问题不),你再把 strict_route 给默认的false吧,最安全。坏处就是测DNS要泄露。不然你要教小白满足上面的条件太累了。

@chika0801
Copy link
Contributor

chika0801 commented May 9, 2023

一个自用示例。有个问题,这是tun模式下,"address": "tcp://1.1.1.1", 这儿改成1.1.1.1看了日志是DNS不通,不知道为什么没研究出问题点来(不知道你遇到过没有)

点击查看
{
  "log": {
    "level": "info",
    "timestamp": true
  },
    "dns": {
        "servers": [
            {
                "tag": "dns_proxy",
                "address": "tcp://1.1.1.1",
                "address_resolver": "dns_direct",
                "strategy": "ipv4_only",
                "detour": "proxy"
            },
            {
                "tag": "dns_direct",
                "address": "dhcp://auto",
                "strategy": "prefer_ipv6",
                "detour": "direct"
            },
            {
                "tag": "dns_block",
                "address": "rcode://success"
            }
        ],
        "rules": [
            {
                "domain_keyword": [
                    "jsdelivr.net"
                ],
                "server": "dns_direct"
            },
            {
                "geosite": [
                    "category-ads-all"
                ],
                "server": "dns_block",
                "disable_cache": true
            },
            {
                "geosite": [
                    "category-games@cn"
                ],
                "server": "dns_direct"
            },
            {
                "geosite": [
                    "geolocation-!cn"
                ],
                "server": "dns_proxy"
            },
            {
                "geosite": [
                    "cn",
                    "private"
                ],
                "server": "dns_direct"
            }
        ]
    },
    "route": {
        "geoip": {
            "download_url": "https://cdn.jsdelivr.net/gh/soffchen/sing-geoip@release/geoip.db",
            "download_detour": "direct"
        },
        "geosite": {
            "download_url": "https://cdn.jsdelivr.net/gh/soffchen/sing-geosite@release/geosite.db",
            "download_detour": "direct"
        },
        "rules": [
            {
                "protocol": "dns",
                "outbound": "dns-out"
            },
            {
                "geosite": [
                    "category-ads-all"
                ],
                "outbound": "block"
            },
            {
                "type": "logical",
                "mode": "and",
                "rules": [
                    {
                        "geosite": [
                            "category-games@cn"
                        ]
                    },
                    {
                        "geoip": [
                            "cn"
                        ]
                    }
                ],
                "outbound": "direct"
            },
            {
                "type": "logical",
                "mode": "and",
                "rules": [
                    {
                        "geosite": [
                            "geolocation-!cn"
                        ]
                    },
                    {
                        "geoip": [
                            "cn"
                        ],
                        "invert": true
                    }
                ],
                "outbound": "proxy"
            },
            {
                "type": "logical",
                "mode": "and",
                "rules": [
                    {
                        "geosite": [
                            "cn"
                        ]
                    },
                    {
                        "geoip": [
                            "cn"
                        ]
                    }
                ],
                "outbound": "direct"
            },
            {
                "geosite": [
                    "private"
                ],
                "outbound": "direct"
            },
            {
                "geoip": [
                    "cn",
                    "private"
                ],
                "outbound": "direct"
            },
            {
                "port": 53,
                "process_name": [
                    "xray.exe",
                    "Xshell.exe",
                    "XshellCore.exe",
                    "WinSCP.exe"
                ],
                "outbound": "dns-out"
            },
            {
                "process_name": [
                    "xray.exe",
                    "Xshell.exe",
                    "XshellCore.exe",
                    "WinSCP.exe"
                ],
                "outbound": "direct"
            }
        ],
        "auto_detect_interface": true
    },
    "inbounds": [
        {
            "type": "tun",
            "tag": "tun-in",
            "interface_name": "tun0",
            "inet4_address": "172.19.0.1/30",
            "inet6_address": "fdfe:dcba:9876::1/126",
            "mtu": 9000,
            "auto_route": true,
            "strict_route": true,
            "endpoint_independent_nat": false,
            "stack": "system",
            "sniff": true,
            "sniff_override_destination": false
        }
    ],
    "outbounds": [
        {
            "type": "socks",
            "tag": "proxy",
            "server": "127.0.0.1",
            "server_port": 10808,
            "version": "5"
        },
        {
            "type": "direct",
            "tag": "direct"
        },
        {
            "type": "block",
            "tag": "block"
        },
        {
            "type": "dns",
            "tag": "dns-out"
        }
    ]
}

@uuiid
Copy link

uuiid commented May 10, 2023

v2rayN.zip

  • 增加了sing-box流量统计和速率显示
  • ws中增加headers host

@uuiid 测试下ws

还是不太有用, 连不上

@2dust
Copy link
Owner Author

2dust commented May 13, 2023

v2rayN.zip

  • 增加了sing-box流量统计和速率显示
  • ws中增加headers host

@uuiid 测试下ws

还是不太有用, 连不上

请查看下v2rayN生成的config.json
和你正常能用的对比,少了什么?

@uuiid
Copy link

uuiid commented May 15, 2023

v2rayN.zip

  • 增加了sing-box流量统计和速率显示
  • ws中增加headers host

@uuiid 测试下ws

还是不太有用, 连不上

请查看下v2rayN生成的config.json 和你正常能用的对比,少了什么?

@2dust

 lookup failed for github.com: tls: failed to verify certificate: x509: certificate is valid for {1}, not {0} 

就是证书验证失败, ヾ(≧▽≦*)o, 老哥, 这个子段少了啊, 我在上面回复说的哪个
tls, server_name 字段啊,o((>ω< ))o


    {
      "alter_id": 0,
      "network": "tcp",
      "security": "auto",
      "server": "",
      "server_port": 63088,
      "tag": "V1-台湾多台负载均衡中继B1.5x",
      "tls": {
        "disable_sni": false,
        "enabled": true,
        "insecure": false,
        "server_name": "填订阅中的host",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        }
      },
      "transport": {
        "headers": {
          "Host": "填订阅中的host"
        },
        "path": "/mugua",
        "type": "ws"
      },
      "type": "vmess",
      "uuid": ""
    }

@uuiid
Copy link

uuiid commented May 15, 2023

@2dust 还有就是sing-box多路复用是不兼容服务端为非sing-box的代理的, 这里sing-box文档有过描述, 我建议是先禁用sing-box的多路复用

@chika0801
Copy link
Contributor

@2dust 还有就是sing-box多路复用是不兼容服务端为非sing-box的代理的, 这里sing-box文档有过描述, 我建议是先禁用sing-box的多路复用

是的,你要两端都用sing-box,才在客户端开启它的 如h2mux padding,如果服务端非sing-box可能有问题。

@uuiid
Copy link

uuiid commented May 15, 2023

@chika0801 是必有问题, 因为文档里面有写( ̄_, ̄ ), 这个是最近才写的(好像( ̄︶ ̄*)))

@chika0801
Copy link
Contributor

@uuiid https://sing-box.sagernet.org/zh/configuration/shared/multiplex/

你是指这个吧,如果是我是一直知道要用这功能,两端肯定是要 sing-box

@uuiid
Copy link

uuiid commented May 15, 2023

@chika0801 没错

我各种组合参数都是过, 只有客户端使用必报错

@2dust
Copy link
Owner Author

2dust commented May 21, 2023

https://github.com/2dust/v2rayN/releases/tag/6.25

@2dust 2dust closed this as completed May 21, 2023
@MDSXQ
Copy link

MDSXQ commented Sep 18, 2023

正常使用,测速显示core运行失败,但是换成管理员运行就没有,并且换了最新版试了,这是为什么,有解决办法吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants