sing-box的IPv4优先 IPv6优先行为受 gai.conf 控制?
前言 群友反馈在Deiban13下不能设置IPv4优先 通过进一步的交流, 群友的意思是 sing-box 向外访问, 无法通过 gai.conf 来设置是 IPv4优先 还是 IPv6优先 群友用的是fakeip的模式, 翻墙客户端发给梯子的数据包中只有域名, 没有IP. 技术基础 用 curl socks5h 模拟翻墙客户端 fakeip 行为 编译getaddrinfo钩子 钩Go程序 编译sing-box https://sing-box.sagernet.org/zh/installation/build-from-source/ 准备测试环境 搭建一个简单的sing-box服务端 官方安装脚本 curl -fsSL https://sing-box.app/install.sh | sh 配置文件 nano /etc/sing-box/test-config.json { "log": { "level": "debug", "output": "test-box.log", "timestamp": true }, "inbounds": [ { "type": "socks", "tag": "socks-in", "listen": "127.0.0.1", "listen_port": 1080 } ], "outbounds": [ { "type": "direct" } ] } 命令行前台运行sing-box(不能Ctrl+C中断, 就这么放着) /usr/bin/sing-box -D /var/lib/sing-box -c /etc/sing-box/test-config.json run 新开一个SSH终端窗口. cur...