XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
24.58k stars 3.84k forks source link

is unlimited mux possible? #2044

Closed BK8000L closed 1 year ago

BK8000L commented 1 year ago

"mux": { "enabled": true, "concurrency": ∞ } can this be implemented? with value of 1024 there is a new connection to my server every few minutes, i want to avoid making new connections and use only 1 connection.

BK8000L commented 1 year ago

it seems to me that every dns request takes 1 connection, but im not sure

rurirei commented 1 year ago

almost not possible as one connection won't keep itself long much as a limit up to 1024 is enough for you.

and attentions the underlying io-blocks of mux. sometimes a possible relives is to keep one connection for as much requests with one target as per #1736 then you could look on a impl at https://github.com/rurirei/v2ray-core/tree/init/common/protocol/mux

BK8000L commented 1 year ago

@rurirei did you use a translator? I did not understand anything. and i don't really get why i am running out of 1024 so quickly when doing almost nothing, just browsing a few websites and youtube. my ISP is very strict and i want as few connections as possible

rurirei commented 1 year ago

. and i don't really get why i am running out of 1024 so quickly when doing almost nothing, just browsing a few websites and youtube.

almost the ISP won't allows you some connections be keep-alive.

RPRX commented 1 year ago

It is possible. Xray-core v1.8.1 轻微地重构了 Mux 的代码,并加了 XUDP 相关的两个选项,看起来是时候暴露更多的控制选项了。

目前,若你希望始终只存在一个长连接,你可以直接使用 H2 / gRPC。

BK8000L commented 1 year ago

@RPRX thank you, grpc works! i used tcp before

BK8000L commented 1 year ago

@RPRX i closed this too soon, after an hour i get two concurrent connections with grpc, mux doesn't seem to change anything, what can i do? using only xray-core on client side, on server side i use nginx with grpc_pass

RPRX commented 1 year ago

https://github.com/XTLS/Xray-core/blob/d9af02812f22aad5d415fb0b01b855d21c2d1078/transport/internet/grpc/dial.go#L86-L88

BK8000L commented 1 year ago

@RPRX what does this mean?

BK8000L commented 1 year ago

after an hour i get two concurrent connections with grpc

keepalive_time 8h; http2_max_concurrent_pushes 999999; http2_max_concurrent_streams 999999; http2_max_requests 999999; keepalive_requests 999999;

this seems to have helped

its0ka commented 3 months ago

grpc mux sucks, if im downloading something it slows down other connections to 0kb/s and i can't do anything on the internet. sing-box yamux works perfectly, except that sing-box itself crashes often, and it probably won't be fixed, so there is no good solution for this case...