hizkifw / wsrelay

Basic pub/sub websocket server following a JSONRPC-ish format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wsrelay

Basic pub/sub websocket server following a JSONRPC-ish format.

Running

  1. Install dependencies: yarn
  2. Run the server: yarn start

Using

  1. Subscribe to a topic
> { "method": "subscribe", "params": [ "topicA", "topicB", "topicC" ] }
< {"id":0,"result":"Success"}
  1. Publish to a topic
> { "method": "publish", "params": [ "topicB", "Hello, world!" ] }
< {"id":0,"result":"Success"}
  1. Receive the message
< {"id":-1,"result":["topicB","Hello, world!"]}

About

Basic pub/sub websocket server following a JSONRPC-ish format.


Languages

Language:JavaScript 100.0%