SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
20.28k stars 2.42k forks source link

版本1.7.1之后部分情况下链式代理无法正常工作 #1916

Open trimgop opened 4 months ago

trimgop commented 4 months ago

操作系统

Windows

系统版本

23H2

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.9.3

Environment: go1.22.4 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 085f60337799afc906069b540a38368968c123e4
CGO: disabled

描述

sing-box 1.7.1及之后的版本,两个使用了tls的代理节点,组成的链式代理无法使用

重现方式

设置如下:

  1. 两个开启了tls的vless节点proxy-1和proxy-2
  2. http入站走proxy-1,proxy-1的detour设为proxy-2

可复现的配置文件:

{
    "inbounds": [
        {
            "listen": "127.0.0.1",
            "listen_port": 2080,
            "sniff": true,
            "sniff_override_destination": false,
            "tag": "mixed-in",
            "type": "mixed"
        }
    ],
    "log": {
        "level": "debug"
    },
    "outbounds": [
        {
            "tag": "proxy-1",
            "detour": "proxy-2",
            "type": "vless",
            "server": "154.219.5.16",
            "server_port": 2053,
            "uuid": "17565eb3-3535-4fc1-bbaa-e9fbd94b2f0c",
            "packet_encoding": "xudp",
            "tls": {
                "enabled": true,
                "insecure": false,
                "server_name": "fi1.v2vless.xyz"
            },
            "transport": {
                "type": "ws",
                "path": "/",
                "headers": {
                    "Host": "fi1.v2vless.xyz"
                }
            }
        },
        {
            "tag": "proxy-2",
            "type": "vless",
            "server": "185.159.247.35",
            "server_port": 443,
            "uuid": "5da27733-3527-479e-bb81-4c5a9c75d83f",
            "packet_encoding": "xudp",
            "tls": {
              "enabled": true,
              "insecure": false,
              "server_name": "viphamester.wolfmoon.ir"
            },
            "transport": {
              "type": "grpc",
              "service_name": "okala.com"
            }
        },
        {
            "tag": "direct",
            "type": "direct"
        },
        {
            "tag": "block",
            "type": "block"
        },
        {
            "tag": "dns-out",
            "type": "dns"
        }
    ],
    "route": {        
        "rules": [
            {
                "outbound": "dns-out",
                "protocol": "dns"
            }
        ],
        "final": "proxy-1"
    },
    "dns": {
    "servers": [
      {
        "tag": "remote-dns",
        "address": "tls://8.8.8.8",
        "detour": "proxy-1"
      },
      {
        "tag": "local-dns",
        "address": "https://223.5.5.5/dns-query",
        "detour": "direct"
      }
    ],
    "rules": [
      {
        "outbound": "any",
        "server": "local-dns"
      }
    ],
    "final": "remote-dns"
  }
}

执行 curl.exe -x "http://127.0.0.1:2080" www.google.com 发起请求

sing-box 1.9.3 版本报错: set read deadline: invalid argument sing-box 1.7.0 版本正常工作

日志

INFO[0000] router: updated default interface 以太网, index 16
INFO[0000] inbound/mixed[mixed-in]: tcp server started at 127.0.0.1:2080
INFO[0000] sing-box started (0.00s)
INFO[0005] [1292959826 0ms] inbound/mixed[mixed-in]: inbound connection from 127.0.0.1:54430
INFO[0005] [1292959826 7ms] inbound/mixed[mixed-in]: inbound connection to www.google.com:80
DEBUG[0005] [1292959826 9ms] router: sniffed protocol: http, domain: www.google.com
INFO[0005] [1292959826 9ms] outbound/vless[proxy-1]: outbound connection to www.google.com:80
INFO[0005] [1292959826 9ms] outbound/vless[proxy-2]: outbound connection to 154.219.5.16:2053
INFO[0005] [1292959826 9ms] outbound/vless[proxy-2]: outbound connection to 154.219.5.16:2053
DEBUG[0006] [1292959826 1.16s] inbound/mixed[mixed-in]: connection closed: process connection from 127.0.0.1:54430: set read deadline: invalid argument | Get "http://www.google.com/": io: read/write on closed pipe

支持我们

完整性要求

ImmortalD commented 1 month ago

这个问题解决了吗。我用的1.10.1也有这个问题

HXHGTS commented 1 week ago

我用1.10.1也有这个问题,把tor出口套在warp上,warp的虚拟网卡显示传输流量为0,经过测试(用完全相同的配置文件)最后一个正常的版本是1.8.14 1.9.0+的虚拟网卡:image 1.8.14以前的虚拟网卡:image

Smart-Kevin commented 1 day ago

Still having this issue on the latest version 1.10.2