![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
websocket
maoer9999
熟练掌握js,vue,nodejs,egg,熟悉go,小程序,ionic等,欢迎关注,互相学习
展开
-
websocket 封装及使用
1.websocket.js 封装好了,直接在项目中引入使用即可class jtWebSocket{ //构造函数 constructor() { this.webSocket = null; //webSocket对象 this.url = null; //webSocket连接的url this.lastHeartBeat = 0; // 上一次心跳时间 this.connectTimer = null; // 重连定时器 this.isPaus..原创 2021-07-08 18:00:47 · 1885 阅读 · 4 评论 -
websocket在项目中的简单使用
var websocket = null; // 建立连接的方法function create_websocket() {// 判断当前浏览器是否支持WebSocket if ('WebSocket' in window) { console.log('客户端的唯一标识为:' + getSessionId()); // var fp1 = new Fingerpr...原创 2018-10-08 09:53:14 · 3386 阅读 · 1 评论