-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
负载均衡测速报错 error: Connection refused (os error 111) #1104
Comments
去掉qtun插件,或者换在一个稳定的网络环境下使用他。 |
能兼容这个插件吗?我想让它搭配 load balancer 一起使用 |
I don't think it has anything related to "compatibility". Since the Is |
不是qtun不兼容,而是当你使用的网络发生了变化,ss client重用之前建立好的连接有可能已经broken,导致你看到的异常。 |
Of course not. The connection in ping balancer is always new. Since this server has plugin, so the If the |
我说qtun呢。 |
Then it won't fail when |
网络是稳定的,服务端和客户端都是刚刚启动,并且另外再开了一个客户端测试过是可用的。
也许这和 qtun 的
应该是支持的,它在源码里也有体现 https://github.com/shadowsocks/qtun/blob/master/src/args/mod.rs#L6-L26 |
The listen IP and port should come from environment variables. Did you see the line |
是的,我发现尽管配置了 |
There is no |
也许我应该把这个 bug 反馈给 qtun 😄 |
Did you really see the log |
是的,日志如下:
|
我发现 qtun 只监听了 UDP 端口,会不会是这个原因?😮 root@HK ~/docker-compose/net/shadowsocks-rust/shadowsocks-rust-data # netstat -naop | grep qtun
udp 0 0 0.0.0.0:2047 0.0.0.0:* 462031/qtun-server off (0.00/0/0)
unix 3 [ ] STREAM CONNECTED 8615865 462031/qtun-server
unix 3 [ ] STREAM CONNECTED 8615866 462031/qtun-server |
Of course, qtun-server should only listen to UDP port, this is QUIC.
qtun-client should listen to |
已经是最新版编译的了,还是有问题,我稍后会向 qtun 再提个 issue. |
@zonyitoo 大佬,还想问下,我把 qtun 插件替换成了 xray-plugin, 使用它的 quic 协议。 相关信息: root@OpenWrt:~# netstat -nap | grep xray-plugin
tcp 0 0 127.0.0.1:39367 0.0.0.0:* LISTEN 26746/xray-plugin
tcp 0 0 127.0.0.1:39367 127.0.0.1:52048 ESTABLISHED 26746/xray-plugin
2023-02-02T17:41:13.223997708+08:00 DEBUG [57:140240382620720] [shadowsocks::plugin] started plugin "xray-plugin" on 127.0.0.1:39367 <-> xxx.xxx.xxx.xxx:2047 (64)
2023-02-02T17:42:48.770454819+08:00 DEBUG [38:140083682825264] [shadowsocks_service::local::loadbalancing::ping_balancer] failed to check TCP server xxx.xxx.xxx.xxx:2047, error: unexpected end of file |
It looks ss-rust doesn't pass |
Hmm, plugins are launched with exactly the same code: shadowsocks-rust/crates/shadowsocks/src/plugin/ss_plugin.rs Lines 25 to 27 in 92c218d
Load balancer is always started even if there is only 1 server. |
Could you please print the value of shadowsocks-rust/crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs Lines 250 to 260 in 92c218d
Just add |
好的,我晚点试试😄 |
@zonyitoo 配置: {
"locals": [
{
"local_address": "127.0.0.1",
"local_port": 12345,
"protocol": "redir",
"tcp_redir": "tproxy",
"udp_redir": "tproxy"
}
],
"servers": [
{
"server": "xxx.xxx.xxx.xxx",
"server_port": 2047,
"password": "xxxxxxxxxxxxxxxxx",
"method": "chacha20-ietf-poly1305",
"mode": "tcp_only",
"plugin": "./qtun-client",
"plugin-opts": "host=example.com"
},
{
"server": "xxx.xxx.xxx.xxx",
"server_port": 2049,
"password": "xxxxxxxxxxxxxxxxx",
"method": "chacha20-ietf-poly1305",
"mode": "tcp_only",
"plugin": "./xray-plugin",
"plugin-opts": "fast-open;mode=quic;host=example.com;loglevel=info"
}
],
"balancer": {
"max_server_rtt": 5,
"check_interval": 30,
"check_best_interval": 15
}
} 日志: root@ARCH ~/shadowsocks-rust/target/debug # ./ssservice local --config ./local.json -v
2023-02-03T22:03:33.325795219+08:00 INFO [6773:139947323509696] [shadowsocks_rust::service::local] shadowsocks local 1.15.2 build 2023-02-03T13:51:12.540902582+00:00
2023-02-03T22:03:33.329036745+08:00 INFO [6773:139947323509696] [shadowsocks_service::local::loadbalancing::ping_balancer] PluginConfig { plugin: "./qtun-client", plugin_opts: None, plugin_args: [] }
2023-02-03T22:03:33.330807188+08:00 DEBUG [6773:139947323509696] [shadowsocks::plugin] started plugin "./qtun-client" on 127.0.[2023-02-03T14:03:33Z INFO qtun_client] listening on 127.0.0.1:8138
0.1:34077 <-> xxx.xxx.xxx.xxx:2047 (6777)
2023-02-03T22:03:33.344471928+08:00 INFO [6773:139947323509696] [shadowsocks_service::local::loadbalancing::ping_balancer] PluginConfig { plugin: "./xray-plugin", plugin_opts: None, plugin_args: [] }
2023-02-03T22:03:33.357091969+08:00 DEBUG [6773:139947323509696] [shadowsocks::plugin] started plugin "./xray-plugin" on 127.0.0.1:34883 <-> xxx.xxx.xxx.xxx:2049 (6780)
2023/02/03 22:03:33 Xray 1.7.3 (Xray, Penetrates Everything.) Custom (go1.20 linux/amd64)
2023/02/03 22:03:33 A unified platform for anti-censorship.
2023/02/03 22:03:33 [Warning] core: Xray 1.7.3 started
2023/02/03 22:03:33 127.0.0.1:46104 accepted tcp:127.0.0.1:0
2023/02/03 22:03:36 127.0.0.1:46106 accepted tcp:127.0.0.1:0
2023-02-03T22:03:36.375806051+08:00 DEBUG [6773:139947323509696] [shadowsocks_service::local::loadbalancing::ping_balancer] failed to check TCP server xxx.xxx.xxx.xxx:2047, error: Connection refused (os error 111)
2023-02-03T22:03:38.459856755+08:00 DEBUG [6773:139947323509696] [shadowsocks_service::local::loadbalancing::ping_balancer] failed to check TCP server xxx.xxx.xxx.xxx:2049, error: unexpected end of file
2023-02-03T22:03:38.460549296+08:00 INFO [6773:139947323509696] [shadowsocks_service::local::loadbalancing::ping_balancer] chose best TCP server xxx.xxx.xxx.xxx:2047
2023-02-03T22:03:38.461702672+08:00 INFO [6773:139947321403136] [shadowsocks_service::local::redir::tcprelay] shadowsocks TCP redirect (tproxy) listening on 127.0.0.1:12345 |
Hmm, that's unexpected! |
Ah, I see. It should be |
@zonyitoo 确实是打错了,改成 |
Maybe we should add Update: opened #1106 |
我的配置文件如下:
启动命令如下:
其中日志第三行出现了
Connection refused (os error 111)
, 而实际是可以使用的。我这里使用了 qtun 插件,服务器中只监听了 UDP 的 2047 端口,请问这是否和这个原因有关?
The text was updated successfully, but these errors were encountered: