sing-box
sing-box copied to clipboard
TUIC 协议不能在服务端嗅探域名
Welcome
- [X] Yes, I'm using the latest major release. Only such installations are supported.
- [X] Yes, I'm using the latest Golang release. Only such installations are supported.
- [X] Yes, I've searched similar issues on GitHub and didn't find any.
- [X] Yes, I've included all information below (version, FULL config, FULL log, etc).
Description of the problem
使用 sing-box 1.4.0-beta.2 新加的 TUIC 协议,试图在客户端使用 fakeip 建立链接,然后在服务端嗅探出域名后再发起 dns 请求真实 ip 地址。但发现 TUIC 协议的入站不能嗅探出域名,直接用 fakeip 发起了链接,其他协议没有发现这个问题。
测试环境为 Chrome 浏览器,通过 SwitchyOmega 插件设置 socks5 代理到 sing-box 的端口。
Version of sing-box
$ sing-box version
sing-box version 1.4.0-beta.2
Environment: go1.21.0 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_reality_server,with_clash_api
Revision: 3442c7a692ca1a3e19b74768033a8924cc26a4d9
CGO: disabled
Server and client configuration file
客户端设置:
{
"log": {
"level": "debug",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "FakeIP",
"address": "fakeip"
}
],
"final": "FakeIP",
"fakeip": {
"enabled": true,
"inet4_range": "244.16.0.0/12",
"inet6_range": "2001:db8:abcd:ef::/64"
},
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed",
"listen": "127.0.0.1",
"listen_port": 25700,
"sniff": true,
"domain_strategy": "prefer_ipv4"
}
],
"outbounds": [
{
"type": "tuic",
"tag": "tuic",
"server": "127.0.0.1",
"server_port": 25710,
"uuid": "da95717a-2ad6-49c3-9fb4-7e332c293fe4",
"password": "9DEBT5TQus4LJliIQeoJmVZLOa/N2hgQ1Uet3M+QufI=",
"tls": {
"enabled": true,
"server_name": "xxx.xxx.xxx",
"alpn": "h3"
}
}
]
}
服务端设置:
{
"log": {
"level": "debug",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "Alibaba",
"address": "tls://223.6.6.6",
"detour": "direct"
}
],
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "tuic",
"tag": "tuic",
"listen": "127.0.0.1",
"listen_port": 25710,
"sniff": true,
"sniff_override_destination": true,
"domain_strategy": "prefer_ipv4",
"users": [
{
"name": "sing",
"uuid": "da95717a-2ad6-49c3-9fb4-7e332c293fe4",
"password": "9DEBT5TQus4LJliIQeoJmVZLOa/N2hgQ1Uet3M+QufI="
}
],
"tls": {
"enabled": true,
"server_name": "xxx.xxx.xxx",
"alpn": "h3",
"certificate_path": "fullchain.pem",
"key_path": "privkey.pem"
}
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct",
"domain_strategy": "prefer_ipv4"
}
]
}
Server and client log file
客户端日志
$ sing-box run -c client.json
+0800 2023-08-11 17:58:32 INFO router: updated default interface MSI, index 19
+0800 2023-08-11 17:58:32 INFO inbound/mixed[mixed]: tcp server started at 127.0.0.1:25700
+0800 2023-08-11 17:58:32 INFO sing-box started (0.11s)
+0800 2023-08-11 17:58:58 INFO [3739902395 0ms] inbound/mixed[mixed]: inbound connection from 127.0.0.1:61546
+0800 2023-08-11 17:58:58 INFO [3739902395 0ms] inbound/mixed[mixed]: inbound connection to www.bing.com:443
+0800 2023-08-11 17:58:58 DEBUG [3739902395 1ms] router: sniffed protocol: tls, domain: www.bing.com
+0800 2023-08-11 17:58:58 DEBUG [3739902395 2ms] dns: lookup domain www.bing.com
+0800 2023-08-11 17:58:58 INFO [3739902395 2ms] dns: lookup succeed for www.bing.com: 244.16.0.3 2001:db8:abcd:ef::3
+0800 2023-08-11 17:58:58 DEBUG [3739902395 2ms] dns: resolved [244.16.0.3 2001:db8:abcd:ef::3]
+0800 2023-08-11 17:58:58 INFO [3739902395 3ms] outbound/tuic[tuic]: outbound connection to 244.16.0.3:443
服务端日志
$ sing-box run -c server.json
+0800 2023-08-11 17:58:55 INFO router: updated default interface MSI, index 19
+0800 2023-08-11 17:58:55 INFO inbound/tuic[tuic]: udp server started at 127.0.0.1:25710
+0800 2023-08-11 17:58:55 INFO sing-box started (0.11s)
+0800 2023-08-11 17:58:58 INFO [2646282238 0ms] inbound/tuic[tuic]: inbound connection to 244.16.0.3:443
+0800 2023-08-11 17:58:58 INFO [2646282238 0ms] outbound/direct[direct]: outbound connection to 244.16.0.3:443