melody icon indicating copy to clipboard operation
melody copied to clipboard

how to keep a connecting, it always timeout after 1 minute

Open kent58909 opened this issue 3 years ago • 1 comments

it always timeout.. not proxy via nginx, only melody + gin, the same code as your example...

this pic:

image

after 1 minute, timeout, disconnect, and reconnect...

kent58909 avatar Apr 09 '21 02:04 kent58909

@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.

CodeDing avatar May 10 '23 06:05 CodeDing