I have found that WebSockets in Chrome and Firefox disconnect after exactly one minute of inactivity. Based on stuff I\'ve seen online, I was all set to blame proxies or some s
The WebSocket protocol specification defines Ping and Pong frames that can be used for keep-alive, heart-beats, network status probing. Ping means client/server is sending an iq to tell the other side server/client that to keep the connection alive and also the other side will send an acknowledgement with pong having same payload data.
You can also define a timeout when the browser stops respond or be considered dead.
read more: http://vunse.blogspot.in/2014/04/websocket-ping-pong.html