ws & websocket & 掉线重连
reconnecting websocket
https://github.com/joewalnes/reconnecting-websocket
https://www.npmjs.com/package/reconnectingwebsocket
const url =`wss://websockets.org/chat?token=1234567890`;
// const url =`ws://websockets.org/chat?token=1234567890`;
let socket = new ReconnectingWebSocket(url, null, {debug: true, reconnectInterval: 3000});
// OR
const url =`wss://websockets.org/chat?token=1234567890`;
let socket = new ReconnectingWebSocket(url);
socket.debug = true;
socket.timeoutInterval = 5400;
http://www.phpernote.com/html5/1370.html
https://github.com/hubspot/offline
心跳检测
https://www.jianshu.com/p/dfde99d46ef4
https://www.cnblogs.com/1wen/p/5808276.html
https://github.com/zimv/websocket-heartbeat-js
https://www.cnblogs.com/1wen/p/5973468.html
https://github.com/zimv/zmCanvasCrop
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!