1.0.4 • Published 2 years ago

lb-websocket v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

lb-websock

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

import

import LbWebsocket from 'lb-websocket'; let websocket = new LbWebsocket({ url: 'ws://xxxxxxx' }); websocket.onopen = function () { console.log('connect success'); websocket.send('hello server'); } websocket.onmessage = function (e) { console.log(onmessage: ${e.data}); } websocket.onreconnect = function () { console.log('reconnecting...'); }

params

  • url websocket连接地址
  • pingTimeout 未收到消息一段时间后发送ping请求
  • pongTimeout 发送ping后消息接收超时时间
  • reconnectTimeout 重连超时时间
  • pingMsg 心跳检测信息
  • repeatLimit 重连限制次数
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago