问题
I have simple chatroom application and if no users send any messages, the websocket closes after about 10 minutes. What is the best solution to keep the connection alive without reconnecting?
回答1:
It is always possible to send pings, the other side will have to reply with pong. (proof)
This tutorial might help you with that.
来源:https://stackoverflow.com/questions/58401092/api-gateway-websockets-dealing-with-10-minute-idle-connection-timeout