bare-ws

WebSocket library for JavaScript

Apache-2.0 13 个版本
安装
npm install bare-ws
yarn add bare-ws
pnpm add bare-ws
bun add bare-ws
README

bare-ws

WebSocket library for JavaScript.

npm i bare-ws

Usage

const ws = require('bare-ws')

const server = new ws.Server({ port: 8080 }, (socket) => {
  socket.on('data', (data) => {
    console.log(data.toString())
  })
})

server.on('listening', () => {
  const socket = new ws.Socket({ port: 8080 })

  socket.write('Hello WebSocket')
})

License

Apache-2.0

版本列表
3.0.0 2026-04-28
2.1.0 2026-02-25
2.0.4 2025-10-28
2.0.3 2025-06-04
2.0.2 2025-06-04
2.0.1 2025-01-02
2.0.0 2024-11-27
1.3.1 2024-08-15
1.3.0 2024-06-14
1.2.1 2024-06-11
1.2.0 2024-06-10
1.1.0 2024-06-10
1.0.0 2024-06-08