bare-ws
v1.3.1
Published
WebSocket library for JavaScript
Downloads
2,684
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