ssbc/ssb-ws

Name: ssb-ws

Owner: Secure Scuttlebutt Consortium

Description: ssb-ws & http server for ssb

Created: 2016-07-02 08:34:46.0

Updated: 2018-04-11 02:48:38.0

Pushed: 2018-04-16 06:05:11.0

Homepage:

Size: 36

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ssb-ws

ssb-ws & http server for ssb.

Work In Progress

 plugins.install ssb-ws

make sure you set a port in your config file (~/.ssb/config).


s": {"port": 8989}

adding your own http handlers

sometimes you need to do http, here is an example sbot plugin that exposes the websocket address.

ire('scuttlebot')
se(require('ssb-ws'))
se({
name: 'test123',
version: '1.0.0',
init: function (sbot) {
  sbot.ws.use(function (req, res, next) {
    if(req.url == '/get-address')
      res.end(sbot.ws.getAddress())
    else next()
  })
}

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.