We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
描述问题 使用sing-box核心时,访问某些冷门国内域名时,因其不在geosite:cn范围内没匹配直接访问。但是也没有按域名解析到ip,并匹配geoip:cn规则走bypass访问。 入站部分请加入 "domain_strategy": "prefer_ipv4" 即可生效。
预期行为: 走bypass路由访问
实际行为: 走了proxy访问
如何复现 增加一个自定义入站进行对比
{ "domain_strategy": "prefer_ipv4", "listen": "::", "listen_port": 3080, "type": "mixed" }
访问bbs.77bike.com,将代理分别设置为缺省的2080和3080进行对比。
日志 2080的日志
INFO[0836] [748105701] inbound/mixed[mixed-in]: inbound connection from 127.0.0.1:56603 INFO[0836] [748105701] inbound/mixed[mixed-in]: inbound connection to bbs.77bike.com:80 INFO[0836] [748105701] outbound/trojan[proxy]: outbound connection to bbs.77bike.com:80
3080的日志
INFO[0881] [3355049828] inbound/mixed[1]: inbound connection from [::1]:56632 INFO[0881] [3355049828] inbound/mixed[1]: inbound connection to bbs.77bike.com:80 INFO[0881] [3355049828] dns: lookup succeed for bbs.77bike.com: 61.147.105.218 INFO[0881] [3355049828] outbound/direct[bypass]: outbound connection to bbs.77bike.com:80
另外,缺省的remote dns选择https://8.8.8.8/dns-query有点慢(tls会话建立有点耗时),建议用 tcp://1.0.0.1
修正办法 用hook js可以解决,下面代码存储为 hook.nekobox.js,放在config目录下,并且配置中启用hook.js(我选了最后一个选项启用+std module,不知道和第二个启用有啥区别)
var globalAny = globalThis; var my_hook = /** @class */ (function () { function my_hook() { this.nekoray = globalAny.nekoray; } my_hook.prototype.hook_core_config = function (config) { var json = JSON.parse(config); this.nekoray.log(json["inbounds"][0]["listen_port"]); json["inbounds"][0]["domain_strategy"] = "prefer_ipv4"; return JSON.stringify(json); }; my_hook.prototype.hook_vpn_config = function (config) { return config; // 返回输入,表示不修改 }; my_hook.prototype.hook_vpn_script = function (script) { return script; }; my_hook.prototype.hook_import = function (content) { return content; }; return my_hook; }()); globalAny.hook = new my_hook;
The text was updated successfully, but these errors were encountered:
出站域名策略也可以在路由设置中设置
我尝试过Prefer IPv4等各类策略,都没有效果。
只有这个改inbound的配置有效果
Sorry, something went wrong.
2.20 出入站域名策略 已应用到 mixed-in
Same issue in Nekobox(version 2.25). The route rule is from default config of bypass local and china, and the default outbound is proxy.
If I visit a domain not in geosite:cn but ip in geoip:cn, it will go proxy but not bypass. And work fine only by adding domain_strategy value.
domain_strategy
No branches or pull requests
描述问题
使用sing-box核心时,访问某些冷门国内域名时,因其不在geosite:cn范围内没匹配直接访问。但是也没有按域名解析到ip,并匹配geoip:cn规则走bypass访问。
入站部分请加入 "domain_strategy": "prefer_ipv4" 即可生效。
预期行为:
走bypass路由访问
实际行为:
走了proxy访问
如何复现
增加一个自定义入站进行对比
访问bbs.77bike.com,将代理分别设置为缺省的2080和3080进行对比。
日志
2080的日志
3080的日志
另外,缺省的remote dns选择https://8.8.8.8/dns-query有点慢(tls会话建立有点耗时),建议用 tcp://1.0.0.1
修正办法
用hook js可以解决,下面代码存储为 hook.nekobox.js,放在config目录下,并且配置中启用hook.js(我选了最后一个选项启用+std module,不知道和第二个启用有啥区别)
The text was updated successfully, but these errors were encountered: