ws4
v11.5.2
Published
WS V5
Downloads
9
Maintainers
Readme
WS5
WS V5
Installation
$ npm i ws5
Usage-Browser
Client:
<!DOCTYPE html>
<script src="https://raw.githubusercontent.com/SliceWire/ws5/master/ws5-browser.js"></script>
<script>
const ws = new WebSocket5('ws://www.host.com/path')
ws.on('open', () => {
console.log('WebSocket Connected')
})
ws.on('message', (message) => {
console.log(message)
})
Usage-Node
Client:
const WebSocket5 = require('ws5')
const ws = new WebSocket5('ws://www.host.com/path')
ws.on('open', () => {
console.log('WebSocket5 Connected')
})
ws.on('message', (message) => {
console.log(message)
})
Server:
const WebSocket5 = require('ws5')
const ws = new WebSocket5.Server({
port: 8080
// Options Are The Same As With WS
})
ws.on('connection', () => {
console.log('Client Connected')
})