New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sighub

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sighub

aids establishing communications between remote endpoints

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

sighub

aids establishing communications between remote endpoints.

Originally forked from signalhub and inspired by cat-lobby. This one uses koa, generates channel ids on the server side and drops all connections when initiator leaves a channel.

api

var hub = sighub();

Returns a koa app.

require('sighub')().listen(5000);

http api

GET /

Creates a new channel and starts a Server-Sent Events (SSE) stream to deliver messages sent to this channel.

  • Accept header must be present and must contain text/event-stream as per the SSE spec.
  • Immediately pushes id of the channel.
  • When initiator leaves, all other subscribers are disconnected.

GET /:id

Starts a Server-Sent Events (SSE) stream to deliver messages sent to the channel specified by the id.

curl -H "Accept: text/event-stream" \
  "http://localhost:5000/6d1bab5aecf38a8432dae2b92e414a02

## POST /:id

Sends a broadcast message to all connected clients to the channel specified by the id.

  • message must be in data parameter. It can be either a json or a form.
curl -H "Content-Type: application/json" -X POST \
  -d '{"data": {"boom": "boom"} }' \
  "http://localhost:5000/6d1bab5aecf38a8432dae2b92e414a02"

# usage

usage: sighub {options}

Options:
  --help, -h     show this message
  --version, -V  show version number
  --port, -p     listen for connections on this port
  --uid, -u      drop permissions to this uid
  --gid, -g      drop permissions to this gid

license

mit

Keywords

signalling

FAQs

Package last updated on 26 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts