chika0801 / sing-box-examples

sing-box 配置示例
https://github.com/SagerNet/sing-box
1.65k stars 276 forks source link

tun模式下naive的客户端该用哪种协议? #33

Closed catcheru closed 11 months ago

catcheru commented 11 months ago

你好,感谢分享sing-box的各种配置。我有个问题请教一下: tun模式下naive的客户端该用哪种协议?用“http”? 可以这样配置吗?

"outbounds": [ { "type": "http", "tag": "http-out", "server": "sample.com", "server_port": 443, "username": "user", "password": "passwd", "path": "", "headers": {}, "tls": {} }, { "type": "direct", "tag": "direct" }, { "type": "block", "tag": "block" }, { "type": "dns", "tag": "dns-out" } ],

chika0801 commented 11 months ago

你意思是你用 naive 协议,naive 客户端是它github主页官方的程序是吧?我记得官方程序是监听本地的Socks端口,所以你在 sing-box 配置中的出站

这样写就是了

        {
            "type": "socks",
            "tag": "proxy",
            "server": "127.0.0.1",
            "server_port": 10808
        },

端口号改成你 naive 对应的那个

catcheru commented 11 months ago

谢谢您的指教,配置好以后第一次运行正常,但ctrl-c断掉naive和sing-box以后,再次运行naive会报错。

[I] ~ ❯❯❯ naive ./Documents/Proxy/naive/config.json [0804/231436.867457:ERROR:socket_posix.cc(93)] CreatePlatformSocket() failed: Too many open files (24) [0804/231436.867635:ERROR:ssl_client_socket_impl.cc(978)] handshake failed; returned -1, SSL error code 1, net_error -100

chika0801 commented 11 months ago

谢谢您的指教,配置好以后第一次运行正常,但ctrl-c断掉naive和sing-box以后,再次运行naive会报错。

[I] ~ ❯❯❯ naive ./Documents/Proxy/naive/config.json [0804/231436.867457:ERROR:socket_posix.cc(93)] CreatePlatformSocket() failed: Too many open files (24) [0804/231436.867635:ERROR:ssl_client_socket_impl.cc(978)] handshake failed; returned -1, SSL error code 1, net_error -100

这情况我也不知道,我平时不用naive,当时测试了下客户端,没久用。

catcheru commented 11 months ago

好的,谢谢。