Closed GektorUA closed 3 months ago
Some debug info on disconnection event, from Server:
2023/02/18 21:12:11 [Info] [1339508826] app/proxyman/inbound: connection ends > proxy/vless/inbound: fallback ends > context canceled 2023/02/18 21:12:14 [Info] [489002943] app/proxyman/inbound: connection ends > proxy/vless/inbound: connection ends > context canceled 2023/02/18 21:12:16 [Info] [56190278] app/proxyman/inbound: connection ends > proxy/vless/inbound: connection ends > context canceled 2023/02/18 21:12:24 [Info] [3568841681] app/proxyman/inbound: connection ends > proxy/vless/inbound: connection ends > context canceled 2023/02/18 21:12:31 [Info] [1612909734] proxy/vless/inbound: firstLen = 24 2023/02/18 21:12:31 [Info] [1612909734] proxy/vless/inbound: fallback starts > proxy/vless/encoding: invalid request version 2023/02/18 21:12:31 [Info] [1612909734] proxy/vless/inbound: realName = EDITED 2023/02/18 21:12:31 [Info] [1612909734] proxy/vless/inbound: realAlpn = h2 2023/02/18 21:12:41 [Info] [1612909734] app/proxyman/inbound: connection ends > proxy/vless/inbound: fallback ends > context canceled
Client side: 2023/02/18 21:12:14 [Info] [2784422048] app/proxyman/inbound: connection ends > proxy/socks: connection ends > context canceled 2023/02/18 21:12:28 [Info] [2112564818] app/proxyman/inbound: connection ends > proxy/socks: connection ends > context canceled 2023/02/18 21:13:06 [Info] [3547964952] app/proxyman/inbound: connection ends > proxy/socks: connection ends > context canceled
I have setup with V2Ray, and there is no such issue with 600 second timeout. Can somebody explain, why there is issue with Xray?
这是 XTLS Vision 开了 Splice 的问题,其实我给 @yuhan6665 提过,只是还没修,是时候回顾一下以前的邮件了
Xray-core 会关闭五分钟(默认值,可改)上下行无数据的连接,下行 Splice 后就不知道它的状态了,靠上行流量让 Xray 知道连接还活跃,绝大多数情况下是没问题的,但听歌的时候可能会出现长时间上行不活跃,Xray 就会关掉连接
So, it's related only for splice? But in xtls vision we can not turn off splice. How to resolve this issue for vision? TCP traffic is continue download, even without upload, can it be tracked or etc?
Hello! Any update? Because of this, ssh sessions are terminated after 10 minutes if there is no activity in them
Can be avoided with ssh keepalive:
Host *
ServerAliveInterval 60
ServerAliveCountMax 10
I'm experiencing this issue on Xray v1.8.13.
I use complex chaining setup and TCP connection over dokodemo gets closed exactly after 600 seconds. None of the timeout options help. XTLS Vision is not in the chain.
2024/05/22 03:31:39 [Info] [5088895089] app/proxyman/inbound: connection ends > proxy/dokodemo: connection ends > context canceled
Connection to 127.0.0.1 closed by remote host.
Transferred: sent 3152, received 3416 bytes, in 599.2 seconds
Not every protocol supports "pings" or keepalive features. Is there a proper fix?
It's a long issue and there is no fix for now.
@uuonda note that anything in the path can cut your TCP connect for inactivity, keepalive is a must
@yuhan6665 Connection is dropped by Xray itself. Exactly after 600 seconds of inactivity. It's very easy to reproduce with the most basic setup of VLESS-WS and dokodemo.
Also, I tried using standalone tools instead of dokodemo and they hold the connection over Xray inbound without issues.
keepalive is a must
Unfortunately, many protocols don't have such features.
Would someone please take a look at this? I tried every timeout option I could find and Xray still kills the connection exactly after 600 seconds. Where is this limit coming from?
Here is a sample config which allows to reproduce the issue. No caddy, no nginx, no CDN.
@RPRX @Fangliding I would appreciate if someone would take a look at this or at least reopen the issue.
2024/05/25 05:50:22 [Info] [3351068346] proxy/vless/inbound: received request for tcp:127.0.0.1:22
...
2024/05/26 06:00:22 [Info] [3351068346] app/proxyman/inbound: connection ends > proxy/vless/inbound: connection ends > proxy/vless/inbound: failed to transfer request payload > websocket: close 1000 (normal)
websocket: close 1000 (normal)
You can see Xray gracefully closes the connection exactly after 10 minutes for reasons unknown.
This one seems unrelated, had no effect when I changed it.
@uuonda yuhan's argument is that any protocol that does not implement keepalive will not work over a real network anyway, and xray is not trying to make those protocols work.
Unfortunately, many protocols don't have such features.
which protocols are that? do they work on any network at all? it seems to me those protocols would be inherently broken on anything other than loopback. note that a solution for SSH keepalive has already been posted.
and which network do you use to test your xray config? the networks that I know of kill idle TCP-without-keepalive much earlier than 10 minutes anyway.
@mmmray I'm fairly certain this is an Xray issue. I can run a keepalive enabled wireguard tunnel over VLESS if you insist. Any dokodemo connection over that tunnel would still be killed by Xray exactly after 10 minutes of inactivity. A tunnel itself would not log any disconnects.
This is a "no data for 10 minutes" timeout. TCP level keepalive has nothing to do with this. SSH has that enabled by default. My connections over the same network to the same server run indefinitely without any extra options. Just not over Xray though.
Could anyone reopen this, please? Or should I open a new issue? I've posted the most basic setup configs that allow to reproduce this.
I think it is already clear from the previous discussion that we cannot keep an inactive connection indefinitely and must have a timeout mechanism
What about configuring this timeout? There is connIdle
and dokodemo timeout
but they have no effect on this. Is not that a bug?
This is a "no data for 10 minutes" timeout. TCP level keepalive has nothing to do with this. SSH has that enabled by default. My connections over the same network to the same server run indefinitely without any extra options. Just not over Xray though.
I think you are missing the point of what I'm saying entirely. I am not talking about TCP keepalive either, I am talking about app-level keepalive. I expect most protocols to have this, and so far nobody mentioned a protocol that doesn't (including SSH). The fix for your "most basic setup" was posted here
@mmmray
I am talking about app-level keepalive
So am I. Where is a keepalive option in telnet?
I have setup xtls-vision with fallback to nginx (mostly, as example: https://github.com/XTLS/Xray-examples/tree/main/All-in-One-fallbacks-Nginx , but delete unused settings). When listen online https TCP radio directly from site i have disconnects every 600 seconds. Have try different online radios, all same, 600 second and stream stuck. I have try edit level for stream:
"levels": { "0": { "handshake": 5, "connIdle": 300, "uplinkOnly": 2, "downlinkOnly": 5, "statsUserUplink": false, "statsUserDownlink": false, "bufferSize": 512 } }
but nothing helps.
I have found in sources only one 600 seconds timeout, can it be related to my problem?