SagerNet / sing-box

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

tproxy quic sniffer 不通 #476

Closed heygo1345678 closed 1 year ago

heygo1345678 commented 1 year ago

Welcome

Description of the problem

我之前测试了 xray和v2ray5.4的quic sniffing, v2ray的是正常的,xray的是坏的,刚刚测试sing box,默认 tproxy的quic sniff不通: https://github.com/XTLS/Xray-core/issues/1804

image

iptables部分我都注释掉了 iptables -t mangle -A V2RAY -p udp --dport 443 -j DROP iptables -t mangle -A V2RAY_MASK -p udp --dport 443 -j DROP

Version of sing-box

```console $ sing-box version sing-box version sing-box version unknown Environment: go1.20.1 linux/amd64 Tags: with_quic,with_wireguard,with_grpc,with_utls,with_reality_server CGO: disabled ```

Server and client configuration file

```console 配置文件: { "dns": { "servers": [ { "tag": "google", "address": "https://1.1.1.1/dns-query", "detour": "direct" }, { "tag": "local", "address": "114.114.114.114", "detour": "direct" }, { "tag": "block", "address": "rcode://success" } ], "rules": [ { "geosite": "category-ads-all", "server": "block", "disable_cache": true }, { //"domain": "p", "geosite": "cn", "server": "local" } ] // "strategy": "ipv4_only" }, "inbounds": [ { "type": "tproxy", "tag": "tproxy-in", "listen": "::", "listen_port": 12346, "tcp_fast_open": false, "udp_fragment": false, "sniff": true, "sniff_override_destination": true, "sniff_timeout": "300ms", "domain_strategy": "prefer_ipv6", "udp_timeout": 300, "proxy_protocol": false, "proxy_protocol_accept_no_header": false // "detour": "another-in" }, { "type": "socks", "tag": "socks-in", "listen": "::", "listen_port": 15353 }, { "type": "direct", "listen": "::", "listen_port": 53, "network": "udp", "sniff": true } ], "outbounds": [ { "tag": "proxy", "packet_encoding": "xudp", "type": "vless", "server": "2600:", "server_port": 443, "uuid": "adf7b8e", "flow": "xtls-rprx-vision", "tls": { "enabled": true, "server_name": "www.microsoft.com", "utls": { "enabled": true, "fingerprint": "safari" }, "reality": { "enabled": true, "public_key": "qKcUq229xl4", "short_id": "" } } }, { "type": "socks", "tag": "proxy2", "server": "127.0.0.1", "server_port": 10801, "version": "5", "network": "tcp", "udp_over_tcp": true //... // 拨号字段 }, { "type": "direct", "tag": "direct" }, { "type": "block", "tag": "block" }, { "type": "dns", "tag": "dns-out" } ], "route": { "rules": [ { "protocol": "dns", "outbound": "dns-out" }, { "port": 53, "outbound": "dns-out" }, { "domain": [ "nginx.org" ], "outbound": "proxy" }, { "geosite": "cn", "geoip": [ "private", "cn" ], "outbound": "direct" }, { "geosite": "category-ads-all", "outbound": "block" } ] //"auto_detect_interface": true } } ```

Server and client log file

```console 日志: DEBUG[0030] [1161532165] dns: exchange quic.nginx.org. IN AAAA DEBUG[0031] [1161532165] dns: exchanged quic.nginx.org NOERROR 600 INFO[0031] [1161532165] dns: exchanged quic.nginx.org SOA nginx.org. 86400 IN SOA ns.nginx.org. hostmaster.nginx.com. 201304644 28800 7200 604800 86400 DEBUG[0035] [3273627549] router: sniffed protocol: tls, domain: quic.nginx.org DEBUG[0035] [3273627549] dns: lookup domain quic.nginx.org DEBUG[0035] [3273627549] dns: exchanged quic.nginx.org NOERROR 600 INFO[0035] [3273627549] dns: exchanged quic.nginx.org A quic.nginx.org. 86400 IN A 35.214.218.230 INFO[0035] [3273627549] dns: lookup succeed for quic.nginx.org: 35.214.218.230 INFO[0035] [3273627549] inbound/tproxy[tproxy-in]: inbound connection to 35.214.218.230:443 INFO[0035] [3273627549] dns: exchanged quic.nginx.org A quic.nginx.org. 86400 IN A 35.214.218.230 INFO[0035] [3273627549] dns: lookup succeed for quic.nginx.org: 35.214.218.230 DEBUG[0035] [3273627549] dns: resolved [35.214.218.230] INFO[0036] [3273627549] outbound/vless[proxy]: outbound connection to 35.214.218.230:443 ```
github-actions[bot] commented 1 year ago

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