Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 842 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 842 Bytes

ws-center

Build Status

A distributed WebSocket server with high level abstractions and HTTP APIs, based on socket.io and its redis adapter.

API Documentation

https://solver-workshop.github.io/ws-center

How to use

Server

Change the configurations in /config folder, and deploy this application.

Client

Clients can use socket.io client to communicate with the server.

const SocketClient = require('socket.io-client')

const client = SocketClient('http://localhost:9001', {
  query: { userId: id },
  path: '/ws'
})

client.on('message', function (body) {
  // ...
})

client.on('connect', function () {
  // ...
})