Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websocket-front

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-front - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "websocket-front",
"version": "1.0.4",
"version": "1.0.5",
"description": "WebSocket client for browser with reconnect and heartbeat",

@@ -5,0 +5,0 @@ "main": "./dist/index.esm.js",

@@ -48,3 +48,3 @@ # websocket-front

onError: errorCallback,
close: closeCallback,
onClose: closeCallback,
})

@@ -68,6 +68,6 @@ const receiveMessage = (message: Event) => {

// 执行某些操作
// 发送消息
socket.send('发送WebSocket消息');
// 执行某些操作
// 关闭WebSocket
socket.close()

@@ -87,13 +87,12 @@

| 名称 | 类型 | 描述 | 默认值 |
| --------------------- | ------- | -------------------------------- | -------- |
| isReconnect | boolean | 是否需要自动重连 | true |
| reconnectTimeout | number | 自动重连间隔时间 | 300ms |
| reconnectRepeat | number | 尝试自动重连的次数 | Infinity |
| isHeartbeat | boolean | 是否支持心跳检测 | 是 |
| pingMsg | string | 心跳检测发送给后端的消息 | 'ping' |
| pingTimeout | number | 发送心跳检测消息的延迟时间 | 30s |
| pongTimeout | number | 多长时间没有收到返回的心跳就重启 | 300ms |
| autoCloseBeforeUnload |
| protocols |
| 名称 | 类型 | 描述 | 默认值 |
| ---------------- | -------- | -------------------------------- | -------- |
| isReconnect | boolean | 是否需要自动重连 | true |
| reconnectTimeout | number | 自动重连间隔时间 | 300ms |
| reconnectRepeat | number | 尝试自动重连的次数 | Infinity |
| isHeartbeat | boolean | 是否支持心跳检测 | 是 |
| pingMsg | string | 心跳检测发送给后端的消息 | 'ping' |
| pingTimeout | number | 发送心跳检测消息的延迟时间 | 30s |
| pongTimeout | number | 多长时间没有收到返回的心跳就重启 | 300ms |
| protocols | string[] | 指定子协议 | [] |

@@ -100,0 +99,0 @@ ### 事件

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc