1.0.0 • Published 10 months ago
falcon-socket v1.0.0
属性 | 必填 | 类型 | 默认值 | 描述 |
---|---|---|---|---|
url | true | string | none | websocket服务端接口地址 |
pingTimeout | false | number | 1000 * 20 | 每隔15秒发送一次心跳,如果收到任何后端消息定时器将会重置 |
pongTimeout | false | number | 1000 * 60 | ping消息发送之后,10秒内没收到后端消息便会认为连接断开 |
reconnectTimeout | false | number | 1000 * 2 | 尝试重连的间隔时间 |
pingMsg | false | string | "HeartBeat" | ping消息值 |
const options = {
url: 'ws://xxxx',
pingTimeout: 1000 * 20,
pongTimeout: 1000 * 60,
reconnectTimeout: 1000 * 2,
pingMsg: "HeartBeat"
}
1.0.0
10 months ago