SagerNet / sing-box

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

1.3.1-beta.1 使用fakeip时,第一次打开网址都会报错 #701

Closed chika0801 closed 1 year ago

chika0801 commented 1 year ago

Welcome

Description of the problem

复现过程:更新到1.3.1-beta.1才出现,启动sing-box,浏览器第1次输入网址,都有如下图的错误,等1秒后网页会自动刷新,此时网页正常打开。然后关sing-box,开sing-box,输入网址,现象重复。替换为1.3.0版本文件无此问题。

屏幕截图 2023-07-07 213950

Version of sing-box

1.3.1-beta.1

Server and client configuration file

客户端配置

点击查看
```jsonc { "log": { "level": "info", "timestamp": true }, "experimental": { "clash_api": { "external_controller": "127.0.0.1:9090", "store_fakeip": true } }, "dns": { "servers": [ { "tag": "dns_proxy", "address": "tls://1.1.1.1", "address_resolver": "dns_direct", "strategy": "ipv4_only", "detour": "proxy" }, { "tag": "dns_direct", "address": "tls://223.5.5.5", "strategy": "prefer_ipv6", "detour": "direct" }, { "tag": "dns_block", "address": "rcode://success" }, { "tag": "dns_fakeip", "address": "fakeip", "strategy": "ipv4_only" } ], "rules": [ { "geosite": [ "category-ads-all" ], "server": "dns_block", "disable_cache": true }, { "type": "logical", "mode": "and", "rules": [ { "geosite": [ "geolocation-!cn" ] }, { "query_type": [ "A", "AAAA" ] } ], "server": "dns_fakeip" }, { "geosite": [ "geolocation-!cn" ], "server": "dns_proxy" }, { "geosite": [ "cn", "private" ], "server": "dns_direct" }, { "query_type": [ "A", "AAAA" ], "server": "dns_fakeip" }, { "outbound": [ "any" ], "server": "dns_direct" } ], "independent_cache": true, "fakeip": { "enabled": true, "inet4_range": "198.18.0.0/15", "inet6_range": "fc00::/18" } }, "route": { "geoip": { "download_url": "https://github.com/soffchen/sing-geoip/releases/latest/download/geoip.db" }, "geosite": { "download_url": "https://github.com/soffchen/sing-geosite/releases/latest/download/geosite.db" }, "rules": [ { "protocol": "dns", "outbound": "dns-out" }, { "process_name": [ "xray.exe", "hysteria.exe", "tuic.exe", "IDMan.exe", "Xshell.exe", "XshellCore.exe", "WinSCP.exe" ], "outbound": "direct" }, { "network": "udp", "port": [ 443 ], "outbound": "block" }, { "geosite": [ "category-ads-all" ], "outbound": "block" }, { "geosite": [ "geolocation-!cn" ], "outbound": "proxy" }, { "geosite": [ "cn", "private" ], "outbound": "direct" }, { "geoip": [ "cn", "private" ], "outbound": "direct" } ], "auto_detect_interface": true }, "inbounds": [ { "type": "tun", "tag": "tun-in", "inet4_address": "172.19.0.1/30", "inet6_address": "fdfe:dcba:9876::1/126", "mtu": 1492, "auto_route": true, "strict_route": true, "stack": "system", "sniff": true, "sniff_override_destination": false } ], "outbounds": [ { "type": "socks", "tag": "proxy", "server": "127.0.0.1", "server_port": 10808 }, { "type": "direct", "tag": "direct" }, { "type": "block", "tag": "block" }, { "type": "dns", "tag": "dns-out" } ] } ```

Server and client log file

客户端日志

www.javbus.com 为测试网址

```console +0800 2023-07-07 21:35:20 DEBUG dns: exchange www.javbus.com. IN A +0800 2023-07-07 21:35:20 DEBUG dns: exchange www.javbus.com. IN AAAA +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 INFO dns: exchanged www.javbus.com. A www.javbus.com. 600 IN A 198.18.0.254 +0800 2023-07-07 21:35:20 DEBUG dns: strategy rejected +0800 2023-07-07 21:35:20 INFO [4034828934 0ms] inbound/tun[tun-in]: inbound packet connection from 172.19.0.1:60559 +0800 2023-07-07 21:35:20 INFO [4034828934 0ms] inbound/tun[tun-in]: inbound packet connection to 172.19.0.2:53 +0800 2023-07-07 21:35:20 DEBUG [4034828934 0ms] router: sniffed packet protocol: dns +0800 2023-07-07 21:35:20 INFO [4034828934 0ms] router: found process path: \Device\HarddiskVolume3\Windows\System32\svchost.exe +0800 2023-07-07 21:35:20 DEBUG [4034828934 0ms] router: match[0] protocol=dns => dns-out +0800 2023-07-07 21:35:20 DEBUG dns: exchange www.javbus.com. IN AAAA +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 DEBUG dns: strategy rejected +0800 2023-07-07 21:35:20 INFO [3966384372 0ms] inbound/tun[tun-in]: inbound connection from 172.19.0.1:6824 +0800 2023-07-07 21:35:20 INFO [3966384372 0ms] inbound/tun[tun-in]: inbound connection to 198.18.0.254:443 +0800 2023-07-07 21:35:20 ERROR [3966384372 0ms] inbound/tun[tun-in]: missing fakeip context +0800 2023-07-07 21:35:20 INFO [4272260901 0ms] inbound/tun[tun-in]: inbound connection from 172.19.0.1:6825 +0800 2023-07-07 21:35:20 INFO [4272260901 0ms] inbound/tun[tun-in]: inbound connection to 198.18.0.254:443 +0800 2023-07-07 21:35:20 ERROR [4272260901 0ms] inbound/tun[tun-in]: missing fakeip context +0800 2023-07-07 21:35:20 DEBUG dns: exchange a.nel.cloudflare.com. IN A +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 INFO [1784388607 0ms] inbound/tun[tun-in]: inbound packet connection from [fdfe:dcba:9876::1]:58806 +0800 2023-07-07 21:35:20 INFO dns: exchanged a.nel.cloudflare.com. A a.nel.cloudflare.com. 600 IN A 198.18.0.255 +0800 2023-07-07 21:35:20 INFO [1784388607 0ms] inbound/tun[tun-in]: inbound packet connection to [fdfe:dcba:9876::2]:53 +0800 2023-07-07 21:35:20 DEBUG [1784388607 0ms] router: sniffed packet protocol: dns +0800 2023-07-07 21:35:20 INFO [1784388607 1ms] router: found process path: \Device\HarddiskVolume3\Windows\System32\svchost.exe +0800 2023-07-07 21:35:20 DEBUG [1784388607 1ms] router: match[0] protocol=dns => dns-out +0800 2023-07-07 21:35:20 DEBUG dns: exchange a.nel.cloudflare.com. IN AAAA +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 DEBUG dns: strategy rejected +0800 2023-07-07 21:35:20 INFO [1945145227 0ms] inbound/tun[tun-in]: inbound packet connection from 172.19.0.1:58806 +0800 2023-07-07 21:35:20 INFO [1945145227 0ms] inbound/tun[tun-in]: inbound packet connection to 172.19.0.2:53 +0800 2023-07-07 21:35:20 DEBUG [1945145227 0ms] router: sniffed packet protocol: dns +0800 2023-07-07 21:35:20 INFO [1945145227 1ms] router: found process path: \Device\HarddiskVolume3\Windows\System32\svchost.exe +0800 2023-07-07 21:35:20 DEBUG [1945145227 1ms] router: match[0] protocol=dns => dns-out +0800 2023-07-07 21:35:20 DEBUG dns: exchange a.nel.cloudflare.com. IN AAAA +0800 2023-07-07 21:35:20 DEBUG dns: match[1] geosite=geolocation-!cn && query_type=[A AAAA] => dns_fakeip +0800 2023-07-07 21:35:20 DEBUG dns: strategy rejected +0800 2023-07-07 21:35:20 INFO [3947665071 0ms] inbound/tun[tun-in]: inbound connection from 172.19.0.1:6826 +0800 2023-07-07 21:35:20 INFO [3947665071 0ms] inbound/tun[tun-in]: inbound connection to 198.18.0.255:443 +0800 2023-07-07 21:35:20 ERROR [3947665071 0ms] inbound/tun[tun-in]: missing fakeip context +0800 2023-07-07 21:35:20 INFO [286620289 0ms] inbound/tun[tun-in]: inbound connection from 172.19.0.1:6827 +0800 2023-07-07 21:35:20 INFO [286620289 0ms] inbound/tun[tun-in]: inbound connection to 198.18.0.255:443 +0800 2023-07-07 21:35:20 ERROR [286620289 0ms] inbound/tun[tun-in]: missing fakeip context +0800 2023-07-07 21:35:21 DEBUG dns: exchange EEEFFDELFEEPFACACACACACACACACACA. IN NIMLOC +0800 2023-07-07 21:35:21 DEBUG dns: exchange EEEFFDELFEEPFACACACACACACACACAAA. IN NIMLOC +0800 2023-07-07 21:35:21 DEBUG dns: exchange FHEPFCELEHFCEPFFFACACACACACACAAA. IN NIMLOC +0800 2023-07-07 21:35:21 DEBUG dns: match[3] geosite=[cn private] => dns_direct +0800 2023-07-07 21:35:21 DEBUG dns: match[3] geosite=[cn private] => dns_direct +0800 2023-07-07 21:35:21 DEBUG dns: match[3] geosite=[cn private] => dns_direct +0800 2023-07-07 21:35:21 INFO [318158275 0ms] inbound/tun[tun-in]: inbound connection from 172.19.0.1:6828 +0800 2023-07-07 21:35:21 INFO [318158275 0ms] inbound/tun[tun-in]: inbound connection to 198.18.0.254:443 +0800 2023-07-07 21:35:21 DEBUG [318158275 0ms] router: found fakeip domain: www.javbus.com +0800 2023-07-07 21:35:21 DEBUG [318158275 0ms] router: sniffed protocol: tls, domain: www.javbus.com +0800 2023-07-07 21:35:21 INFO [318158275 1ms] router: found process path: \Device\HarddiskVolume3\Program Files\Google\Chrome\Application\chrome.exe +0800 2023-07-07 21:35:21 DEBUG [318158275 1ms] router: match[5] geosite=geolocation-!cn => proxy +0800 2023-07-07 21:35:21 INFO [318158275 1ms] outbound/socks[proxy]: outbound connection to www.javbus.com:443 ```
chika0801 commented 1 year ago

https://github.com/SagerNet/sing-box/commit/9d75385bbb8e9a51eea5673d22bd0d98062ae2e7

测试这个后,已修复

univerioiln233 commented 1 year ago

你好骚啊.jpg