TyK

Results 9 comments of TyK

Test looks fine. log ac&bat : https://gist.github.com/tisyang/477bd6e053f9a6f19a9870bc09dc1a77

我也遇到了,outbound 为 direct 分流局域网的 web 服务,浏览器关闭后,sing-box 继续持有大量局域网的 web 服务连接,久久不释放

运行环境: ``` sing-box version 1.10.0-beta.5 Environment: go1.23.0 linux/amd64 Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api Revision: 1332f13ce91e8f15ec67954d242732cbd45e39f8 CGO: disabled ``` 主要复现过程: 1. Firefox 设置全局代理为本地 SOCKS5 到 sing-box 的 mixed inbound. 2. sing-box mixed inbound 根据...

> > 我也遇到了,outbound 为 direct 分流局域网的 web 服务,浏览器关闭后,sing-box 继续持有大量局域网的 web 服务连接,久久不释放 > > 我这里也是大量的direct没有回收 你试试 1.9.4 版本

> > > > 你试试 1.9.4 版本 > > 已经是1.9.4了哦,你的正常? 不正常,但是比 1.10beta5 要好一点点,关掉浏览器就回收了

> @tisyang 1.10直接使用1.9.4的配置文件可以吗 应该是可以行的。 我的换 1.9.4 后,问题消失,不影响正常应用了。

通过修改 sagernet/sing 下的 `http.Transport`,参考 https://pkg.go.dev/net/http#hdr-Clients_and_Transports 的参数,基本可以解决 `Direct` 出口连接某些网站连接数过多的问题,有兴趣的可以自行编译测试一下。 自行编译需要将 https://github.com/SagerNet/sing-box/blob/dev-next/go.mod#L57 这行注释打开,然后在将 关修改过的`sagernet/sing` 和 `sagernet/sing-box` 放到同一目录,进 `sing-box` 后 `make` 即可。 目前测试之前出现问题的网页,开3个标签页,连接数可以稳定在 170+ 左右(页面主要有一堆定时的 fetch 操作会不断创建 http 请求)。

@yyjdelete 你可以参考这个修改自行编译 sing-box 测试一下: https://github.com/SagerNet/sing/pull/73 降低 IdleConnTimeout 后,http(s) 连接的回收和复用会更积极一点,可以避免连接数过多。

> I guess the most straightforward thing would be to introduce (propose) a new type like IIO_VAL_FRACTIONAL_PICO (or with a better name) where we would add 12 decimals (or even...