You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/07 09:15:42 UTC
[GitHub] [apisix] loongzh opened a new issue #5440: Websocket代理客户端建立的连接会在5秒左右被服务端自动断开
loongzh opened a new issue #5440:
URL: https://github.com/apache/apisix/issues/5440
### Issue description
apisix配置websocket代理后,客户端建立的连接会在5秒后自动断开
1)确保本地测试处于正常状态
2) APIX开启了WebSocket代理,连接收发消息正常
3)服务本身没有配置nginx代理,所以没有[Websoket多层代理](https://github.com/apache/apisix/issues/4234)的情况
### Environment
- apisix version (cmd: `apisix version`):
- OS (cmd: `uname -a`):
- OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
- etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
- apisix-dashboard version, if have:
- the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
- luarocks version, if the issue is about installation (cmd: `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-976039150
> Hi, I had the same issue.
>
>
>
> For me the connection was being reset because the 6s timeout (send/receive) was too fast for the heartbeat.
>
>
>
> Socket.io (the library i am using) send heartbeats every 25s so increasing send/recieve timeout to 30s did the trick.
>
>
>
> https://stackoverflow.com/questions/12815231/controlling-the-heartbeat-timeout-from-the-client-in-socket-io
>
>
If we don't have a better solution now, we may document this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-964271053
> @loongzh Could you try to configure the backend or the client, so that Ping frame can be sent periodically.
The front-end monitors the disconnection event to reconnect, and sends a message to the server to ensure the normal use of WebSocket
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-976085139
> Hi, I had the same issue.
>
> For me the connection was being reset because the 6s timeout (send/receive) was too fast for the heartbeat.
>
> Socket.io (the library i am using) send heartbeats every 25s so increasing send/recieve timeout to 30s did the trick.
>
> [stackoverflow.com/questions/12815231/controlling-the-heartbeat-timeout-from-the-client-in-socket-io](https://stackoverflow.com/questions/12815231/controlling-the-heartbeat-timeout-from-the-client-in-socket-io)
we can set timeout in upstream to large?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974600363
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] mjsmagalhaes edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
mjsmagalhaes edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-975759572
Hi, I had the same issue.
For me the connection was being reset because the 6s timeout (send/receive) was too fast for the heartbeat.
Socket.io (the library i am using) send heartbeats every 25s so increasing send/recieve timeout to 30s did the trick.
https://stackoverflow.com/questions/12815231/controlling-the-heartbeat-timeout-from-the-client-in-socket-io
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962993810
@loongzh Could you check out the behavior of the backend server when the connection was aborted? We need to make sure whether the "disconnect" is made by the backend server or Apache APISIX.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963000120
> @loongzh Could you check out the behavior of the backend server when the connection was aborted? We need to make sure whether the "disconnect" is made by the backend server or Apache APISIX.
Local and service without using APISIX proxy, after many tests, there will be no disconnection
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-964074810
> @loongzh Could you try to configure the backend or the client, so that Ping frame can be sent periodically.
And then let's check out whether the connection will be aborted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974849228
> 坦白说,APISIX 和 Nginx 的 websocket 代理行为应该是一样的。
In fact, I think the websocket proxy behavior of APISIX is same as Nginx.
the connection will be closed if the proxied server does not transmit any data within 60 seconds in Nginx.
here is my step:
1. start a websocket backend:
```
websocat -s 1234
```
2. start openresty, here is my config:
```
http {
server {
listen 1980;
access_log off;
location / {
proxy_pass http://127.0.0.1:1234;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}
```
3. start websocker client, connect to openresty
```
websocat ws://127.0.0.1:1980/
```
After 60s of not sending a message, the connection is broken.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974603801
> > Directly using the Nginx proxy will not cause the service to actively disconnect the client connection.
>
>
>
> Not true, see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
>
>
>
> ```
>
> By default, the connection will be closed if the proxied server does not transmit any data within 60 seconds. This timeout can be increased with the proxy_read_timeout directive. Alternatively, the proxied server can be configured to periodically send WebSocket ping frames to reset the timeout and check if the connection is still alive.
>
> ```
>
>
>
> @tokers
>
>
>
> > Can we reset the timeout settings once the connection is upgraded to websocket?
>
>
>
> maybe we could enhance this, but I think that the client still has to keep heartbeat with server on websocket?
>
> otherwise the connection would be stop after the timeout period.
Frankly, the websocket proxy behavior of APISIX and Nginx should be same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-964074117
It's strange that the WebSocket connection will be subjected to the timeout settings, since after the connection was "upgraded" tot WebSocket, all timers on it were removed, the connection was aborted only if the upstream or downstream close it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962722885
proviode the reproduction steps and env info
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-973887061
> @loongzh @tokers @shuaijinchao after testing, I have some conclusions:
>
> 1. the `timeout` configuration affect websocket connecrtion, the connection will be closed by APISIX if the proxied server does not transmit any data within `timeout`, which is expect behavior.
> 2. client needs to actively maintain a heartbeat with the server to prevent disconnection
>
> also see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
@tzssangglass Can we reset the timeout settings once the connection is upgraded to websocket?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974603801
> > Directly using the Nginx proxy will not cause the service to actively disconnect the client connection.
>
>
>
> Not true, see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
>
>
>
> ```
>
> By default, the connection will be closed if the proxied server does not transmit any data within 60 seconds. This timeout can be increased with the proxy_read_timeout directive. Alternatively, the proxied server can be configured to periodically send WebSocket ping frames to reset the timeout and check if the connection is still alive.
>
> ```
>
>
>
> @tokers
>
>
>
> > Can we reset the timeout settings once the connection is upgraded to websocket?
>
>
>
> maybe we could enhance this, but I think that the client still has to keep heartbeat with server on websocket?
>
> otherwise the connection would be stop after the timeout period.
Frankly, the websocket proxy behavior of APISIX and Nginx should be same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962765793
apisix 版本 (cmd:) apisix version:2.6
操作系统(命令:)uname -a:Linux 58b4c36fe0ae 3.10.0-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 Linux. ----Docker容器环境
OpenResty / Nginx 版本(cmd:nginx -V或openresty -V):nginx version: openresty/1.19.3.1
etcd 版本,如果有(cmd:运行curl http://127.0.0.1:9090/v1/server_info以从服务器信息 API 获取信息):
apisix-dashboard 版本,如果有:
插件运行器版本,如果问题与插件运行器有关(cmd:取决于运行器的类型):
luarocks 版本,如果问题是关于安装 (cmd:) luarocks --version:/usr/local/openresty/luajit/bin/luarocks 3.7.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963014533
> > @loongzh Could you check out the behavior of the backend server when the connection was aborted? We need to make sure whether the "disconnect" is made by the backend server or Apache APISIX.
>
> Local and service without using APISIX proxy, after many tests, there will be no disconnection
I mean, are there any logs printed in the backend server? When the connection is aborted? We may get some clues from the backend server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-965942729
@loongzh @tokers @shuaijinchao
after testing, I have some conclusions:
1. the `timeout` configuration affect websocket connecrtion, the connection will be closed by APISIX if the proxied server does not transmit any data within `timeout`, which is expect behavior.
2. client needs to actively maintain a heartbeat with the server to prevent disconnection
also see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-965942729
@loongzh @tokers @shuaijinchao
after testing, I have some conclusions:
1. the `timeout` configuration affect websocket connecrtion, the connection will be closed if the proxied server does not transmit any data, APISIX will actively disconnect the connection, which is expect behavior.
2. client needs to actively maintain a heartbeat with the server to prevent disconnection
also see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974979235
> > 坦白说,APISIX 和 Nginx 的 websocket 代理行为应该是一样的。
>
> In fact, I think the websocket proxy behavior of APISIX is same as Nginx.
>
> the connection will be closed if the proxied server does not transmit any data within 60 seconds in Nginx.
>
> here is my step:
>
> 1. start a websocket backend:
>
> ```
> websocat -s 1234
> ```
>
> 2. start openresty, here is my config:
>
> ```
> http {
>
> server {
> listen 1980;
>
> access_log off;
> location / {
> proxy_pass http://127.0.0.1:1234;
> proxy_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "upgrade";
> }
> }
> }
> ```
>
> 3. start websocker client, connect to openresty
>
> ```
> websocat ws://127.0.0.1:1980/
> ```
>
> After 60s of not sending a message, the connection is broken.
That makes sense. @loongzh I checked out the related codes in Nginx, it's an expected behavior. If the proxied server gives up the timeout settings, it might be overwhelmed by a lot of WebSocket connections, from it's own point of view, this is necessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-973803128
The problem has been solved by the new method of heartbeat, but it is not an ideal way. Directly using the Nginx proxy will not cause the service to actively disconnect the client connection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962984541
> hi, @loongzh @tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
- up stream
{
"nodes": [
{
"host": "172.19.0.1",
"port": 8002,
"weight": 1
}
],
"timeout": {
"connect": 6,
"read": 6,
"send": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass",
"name": "lion-metro-server-file-manager",
"desc": "文件管理服务"
}
- Router
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
Just turned on the WebSocket proxy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962984541
> hi, @loongzh @tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963192826
> * "timeout": {
> "connect": 6,
> "read": 6,
> "send": 6
> },
if change 6 to 10, what will happen?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-974600363
> Directly using the Nginx proxy will not cause the service to actively disconnect the client connection.
Not true, see: https://nginx.org/en/docs/http/websocket.html?_ga=2.219808217.1349535884.1636598551-1257987705.1633943387
```
By default, the connection will be closed if the proxied server does not transmit any data within 60 seconds. This timeout can be increased with the proxy_read_timeout directive. Alternatively, the proxied server can be configured to periodically send WebSocket ping frames to reset the timeout and check if the connection is still alive.
```
@tokers
> Can we reset the timeout settings once the connection is upgraded to websocket?
maybe we could enhance this, but I think that the client still has to keep heartbeat with server on websocket?
otherwise the connection would be stop after the timeout period.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] shuaijinchao commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
shuaijinchao commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962944082
hi, @loongzh
@tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962984541
> 嗨,@loongzh @tzssangglass 的意思是提供APISIX的具体配置信息和验证方法,以便我们复现这个问题。
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
> hi, @loongzh @tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962984541
> hi, @loongzh @tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
- up stream
{
"nodes": [
{
"host": "172.19.0.1",
"port": 8002,
"weight": 1
}
],
"timeout": {
"connect": 6,
"read": 6,
"send": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass",
"name": "lion-metro-server-file-manager",
"desc": "文件管理服务"
}
- Router
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
Just turned on the WebSocket proxy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-964003056
> What happens if don't set the `timeout`?
It will disconnect after 1 minute
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] wujie1993 removed a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
wujie1993 removed a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-992079104
Any solutions? I have the same issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] wujie1993 commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
wujie1993 commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-992079104
Any solutions? I have the same issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-962984541
> hi, @loongzh @tzssangglass means to provide specific configuration information and verification methods of APISIX so that we can reproduce this problem.
{
"uris": [
"/api/filemanager/v1/*"
],
"name": "lion-metro-server-file-manager-router",
"upstream_id": "374894233917588162",
"enable_websocket": true,
"status": 1
}
Just turned on the WebSocket proxy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh edited a comment on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh edited a comment on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963756799
> > * "timeout": {
> > "connect": 6,
> > "read": 6,
> > "send": 6
> > },
>
> if change 6 to 10, what will happen?
"timeout": {
"connect": 16,
"read": 16,
"send": 16
}
Will be disconnected after 16s,Can be set up to 5 minutes after testing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-964074405
@loongzh Could you try to configure the backend or the client, so that Ping frame can be sent periodically.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963849157
What happens if don't set the `timeout`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] loongzh commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
loongzh commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-963756799
> > * "timeout": {
> > "connect": 6,
> > "read": 6,
> > "send": 6
> > },
>
> if change 6 to 10, what will happen?
"timeout": {
"connect": 16,
"read": 16,
"send": 16
}
Will be disconnected after 16s
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] mjsmagalhaes commented on issue #5440: request help: the connection established by the Websocket proxy client will be automatically disconnected by the server in about 5 seconds
Posted by GitBox <gi...@apache.org>.
mjsmagalhaes commented on issue #5440:
URL: https://github.com/apache/apisix/issues/5440#issuecomment-975759572
Hi, I had the same issue.
For me the connection was being reset because the 6s timeout (send/receive) was too fast for the heartbeat.
Socket.io (the library i am using) send heartbeats every 25 so increasing it to 30s did the trick.
https://stackoverflow.com/questions/12815231/controlling-the-heartbeat-timeout-from-the-client-in-socket-io
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org