Open kent58909 opened 3 years ago
@kent58909 it may be caused by the client implementing by gin
framework which does not set the websocket's ping handler. If the session
of the melody
instance sends a pingMessage
to the client, but the session
does not received the pongMessage
as response,then the underlying network connection will be corrupted.
Advise
Try to find a solution that setting up the websocket's pingHandler
in your client code which must send a pongMessage
as the response to the peer.
I hope that it may be helpful for you.
I ran into this issue today. I was using the gorilla websocket client, and had to explicitly create a reader goroutine to handle the server's ping message. You can reset the read deadline in the client every time the server sends its ping message.
it always timeout.. not proxy via nginx, only melody + gin, the same code as your example...
this pic:
after 1 minute, timeout, disconnect, and reconnect...