Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

xray能否开发一个保持mux长连接的功能

Open wenzhuning opened this issue 1 year ago • 10 comments

xray能否开发一个保持mux长连接的功能,这个需求的原因是:mux是阻塞式的,得设置connIdle值为3,才能降低阻塞时长,但是有一个缺点,就是子连接没办法保持长连接,导致mux连接也没办法保持长连接,如果可以单独给mux连接设置一个心跳值,维持本身的长连接,那既可以解决阻塞,又能保持长连接,完美解决mux缺陷

wenzhuning avatar Dec 16 '22 00:12 wenzhuning

至于为什么一定要使用mux,一个重要的原因是cdn只支持ws

wenzhuning avatar Dec 16 '22 00:12 wenzhuning

grpc也可以cdn吧?

Fedsd1 avatar Dec 16 '22 00:12 Fedsd1

grpc也可以cdn吧?

有些cdn不支持,比如加速乐和百度智能云cdn

wenzhuning avatar Dec 16 '22 00:12 wenzhuning

grpc也可以cdn吧?

国内的cdn厂商大部分都不支持

wenzhuning avatar Dec 16 '22 00:12 wenzhuning

cdn开mux有什么区别吗

Fedsd1 avatar Dec 16 '22 01:12 Fedsd1

cdn开mux有什么区别吗

没区别我就不会发起这个问题了,mux可以降低延迟

wenzhuning avatar Dec 16 '22 01:12 wenzhuning

You know, MUX in itself willn't improve peformance, the most import key is hide its features, say package length, or any others to a degree hard to distinguish via machine learning which could discriminate traffic behind encrypted HTTPS.

cross-hello avatar Dec 16 '22 03:12 cross-hello

You know, MUX in itself willn't improve peformance, the most import key is hide its features, say package length, or any others to a degree hard to distinguish via machine learning which could discriminate traffic behind encrypted HTTPS.

My suggestion is to solve the defects of mux itself. I know it will not improve performance. It has nothing to do with what you said

wenzhuning avatar Dec 16 '22 04:12 wenzhuning

Maybe could use TCPKeepAliveInterval to extend time during.

 "streamSettings": {
        "network": "tcp",
        "sockopt": {
          "tcpKeepAliveInterval": 120//vless/vmess max connection intervals is 120s.
        }

cross-hello avatar Dec 16 '22 05:12 cross-hello

也许可以使用TCPKeepAliveInterval来延长时间。

 "streamSettings": {
        "network": "tcp",
        "sockopt": {
          "tcpKeepAliveInterval": 120//vless/vmess max connection intervals is 120s.
        }

这个方法行不通,试过了,tcpKeepAliveInterval只会对子连接生效,但是不会对mux连接自身生效,所以我才发起这个建议,希望tcpKeepAliveInterval值可以对mux连接自身生效,而不仅仅是对子连接

wenzhuning avatar Dec 16 '22 07:12 wenzhuning