sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

链式代理似乎无法使用

Open Xeath opened this issue 1 year ago • 2 comments

Operating system

Windows

System version

21H2 (22000.2538)

Installation type

Third-party graphical clients that advertise themselves as using sing-box (Windows)

If you are using a graphical client, please provide the version of the client.

v2rayN - V6.43

Version

sing-box version 1.9.0-rc.9

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

Description

出站标签 proxy 的配置设置了 detour 值为 proxy2,此时访问会出现 set read deadline: invalid argument,但是两个出站配置在不设置 detour 并且使用相同的路由设置则都可以正常访问。

Reproduction

v2rayN 启用 TUN 模式,路由模式选择 绕过大陆订阅分组 中的 前置代理别名 填写一个节点别名。

另外我也尝试了最小的配置信息,但是也是相同的错误信息。

+0800 2024-04-23 12:12:01 INFO router: updated default interface Ethernet0, index 18
+0800 2024-04-23 12:12:01 INFO inbound/socks[socks]: tcp server started at 127.0.0.1:10808
+0800 2024-04-23 12:12:01 INFO inbound/http[http]: tcp server started at 127.0.0.1:10809
+0800 2024-04-23 12:12:01 INFO sing-box started (0.22s)
+0800 2024-04-23 12:12:04 INFO [3331734346 0ms] inbound/socks[socks]: inbound connection from 127.0.0.1:60780
+0800 2024-04-23 12:12:04 INFO [2042808443 0ms] inbound/socks[socks]: inbound connection from 127.0.0.1:60782
+0800 2024-04-23 12:12:04 INFO [3049124449 0ms] inbound/socks[socks]: inbound connection from 127.0.0.1:60781
+0800 2024-04-23 12:12:04 INFO [3331734346 1ms] inbound/socks[socks]: inbound connection to chromewebstore.google.com:443
+0800 2024-04-23 12:12:04 DEBUG [3331734346 3ms] router: sniffed protocol: tls, domain: chromewebstore.google.com
+0800 2024-04-23 12:12:04 DEBUG [3331734346 3ms] router: match[0] inbound=[socks http] => proxy
+0800 2024-04-23 12:12:04 INFO [3331734346 3ms] outbound/vmess[proxy]: outbound connection to chromewebstore.google.com:443
+0800 2024-04-23 12:12:04 INFO [3331734346 4ms] outbound/vmess[proxy2]: outbound connection to proxy.address:443
+0800 2024-04-23 12:12:07 ERROR [3049124449 2.59s] inbound/socks[socks]: process connection from 127.0.0.1:60781: set read deadline: invalid argument

config.json 文件

{
  "log": {
    "level": "debug",
    "timestamp": true
  },
  "dns": {},
  "inbounds": [
    {
      "type": "socks",
      "tag": "socks",
      "listen": "127.0.0.1",
      "listen_port": 10808,
      "sniff": true,
      "sniff_override_destination": true
    },
    {
      "type": "http",
      "tag": "http",
      "listen": "127.0.0.1",
      "listen_port": 10809,
      "sniff": true,
      "sniff_override_destination": true
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "dns",
      "tag": "dns_out"
    },
    {
      "type": "vmess",
      "tag": "proxy",
      "server": "proxy.address",
      "server_port": 443,
      "uuid": "uuid",
      "security": "auto",
      "alter_id": 0,
      "detour": "proxy2",
      "tls": {
        "enabled": true,
        "server_name": "domain.hostname",
        "insecure": false
      },
      "transport": {
        "type": "ws",
        "path": "/",
        "headers": {
          "Host": "domain.hostname"
        }
      }
    },
    {
      "type": "vmess",
      "tag": "proxy2",
      "server": "proxy2.address",
      "server_port": 443,
      "uuid": "uuid",
      "security": "auto",
      "alter_id": 0,
      "tls": {
        "enabled": true,
        "server_name": "domain.hostname",
        "insecure": false
      },
      "transport": {
        "type": "ws",
        "path": "/",
        "headers": {
          "Host": "domain.hostname"
        }
      }
    }
  ],
  "route": {
    "rules": [
      {
        "outbound": "proxy",
        "inbound": [
          "socks",
          "http"
        ]
      }
    ]
  }
}

Logs

+0800 2024-04-23 11:19:11 DEBUG [47136663 1ms] router: sniffed protocol: tls, domain: prod-westus2.access-point.cloudmessaging.edge.microsoft.com
+0800 2024-04-23 11:19:11 INFO [47136663 1ms] router: found process path: \Device\HarddiskVolume3\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
+0800 2024-04-23 11:19:11 DEBUG [47136663 1ms] router: match[12] port_range=0:65535 => proxy
+0800 2024-04-23 11:19:11 INFO [47136663 1ms] outbound/vmess[proxy]: outbound connection to prod-westus2.access-point.cloudmessaging.edge.microsoft.com:443
+0800 2024-04-23 11:19:11 INFO [47136663 1ms] outbound/vless[proxy2]: outbound connection to proxy.ipaddress:443
+0800 2024-04-23 11:19:11 DEBUG [47136663 1ms] dns: lookup domain proxy2.domain
+0800 2024-04-23 11:19:11 DEBUG [47136663 1ms] dns: match[0] domain=proxy2.domain => local
+0800 2024-04-23 11:19:11 DEBUG [47136663 171ms] dns: exchanged proxy2.domain NOERROR 260
+0800 2024-04-23 11:19:11 DEBUG [47136663 171ms] dns: exchanged proxy2.domain A proxy2.domain. 260 IN A 172.67.175.180
+0800 2024-04-23 11:19:11 DEBUG [47136663 171ms] dns: exchanged proxy2.domain A proxy2.domain. 260 IN A 104.21.48.11
+0800 2024-04-23 11:19:11 DEBUG [47136663 171ms] dns: lookup succeed for proxy2.domain: 172.67.175.180 104.21.48.11
+0800 2024-04-23 11:19:11 INFO [2390463144 1.4s] outbound/vless[proxy2]: outbound connection to proxy.ipaddress:443
+0800 2024-04-23 11:19:11 ERROR [2992993800 3.7s] inbound/tun[tun-in]: set read deadline: invalid argument
+0800 2024-04-23 11:19:11 ERROR [579079034 1.77s] inbound/tun[tun-in]: set read deadline: invalid argument
+0800 2024-04-23 11:19:11 ERROR [2361271418 1.77s] inbound/tun[tun-in]: set read deadline: invalid argument
+0800 2024-04-23 11:19:11 INFO [3763010038 2.31s] outbound/vless[proxy2]: outbound connection to proxy.ipaddress:443
+0800 2024-04-23 11:19:11 ERROR [2937366485 2.37s] inbound/tun[tun-in]: set read deadline: invalid argument

Supporter

Integrity requirements

  • [X] I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • [X] I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • [X] I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • [X] I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.

Xeath avatar Apr 23 '24 04:04 Xeath

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jun 23 '24 01:06 github-actions[bot]

I have got the same issue. Same client config can work in windows 10 but not windows 11. V2RayN latest version. Tried to change the old version sing-box (1.8.14) in bin folder of V2RayN but no luck. Need support.

vd3030 avatar Jun 26 '24 15:06 vd3030

遇到了同样的问题, 两个outbound分别都能联通,outbound2作为outboud1的detour后,节点outboud1无法联通

root@singbox:~# singbox version
sing-box version 1.10.0-alpha.21

Environment: go1.22.5 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: d46daeb790a002b13664c89b09068b6ab84f2b04
CGO: disabled

MaleicAcid avatar Jul 22 '24 04:07 MaleicAcid

请问解决了吗?我也遇到了同样问题,vless detour到socks5失败

AntiC1019 avatar Mar 08 '25 01:03 AntiC1019