Registry / messaging / ssb-ws

ssb-ws

JSON →
library6.2.3jsnpmunverified

WebSocket and HTTP server for Secure Scuttlebutt (SSB) clients. Version 6.2.3. Provides a web server that integrates with Scuttlebot, enabling ssb clients (as in scuttle-shell) and browser-based replication via WebSocket. It also exposes an HTTP interface for plugins (e.g., blobs, emoji) using connect-style middleware. Configurable via multiserver connections with SHS authentication for security. Note: noauth mode is not recommended due to DNS rebinding risks.

npm install ssb-ws
INSTALL
IMPORT
SIG · SSB-WS
S
ssb-ws
messagingjavascriptv6.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const ws = require('ssb-ws')
import ws from 'ssb-ws'
This package is CommonJS only; ESM import is not supported.

Starts an ssb-ws server with SHS authentication, adds a custom HTTP route, and demonstrates basic usage.

const SecretStack = require('secret-stack') const SSB = require('scuttlebutt') const config = { connections: { incoming: { ws: [{ scope: ['public', 'local', 'device'], port: 9000, transform: 'shs', http: true }] } } } const sbot = SecretStack({appKey: '1KHLiL8i8oPHLJy4fP4HhCuahkbGUYT1I9yHjKQ='}) .use(require('ssb-ws')) .use({ name: 'example', version: '1.0.0', init: function (sbot) { sbot.ws.use(function (req, res, next) { if (req.url === '/hello') { res.end('Hello from ssb-ws!') } else { next() } }) } }) sbot.call('example.hello') sbot.close()
Debug
Known issues
breakingNoauth mode is vulnerable to DNS rebinding attacks; do not use in production without SHS transport.
fix
Configure incoming ws connections with transform: 'shs' to enable secure handshake.
affects: >=6.0.0
deprecatedThe plugin install syntax 'sbot.plugins.install ssb-ws' is deprecated; use .use(require('ssb-ws')) instead.
fix
Replace 'sbot.plugins.install ssb-ws' with sbot.use(require('ssb-ws')).
affects: >=6.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ssb-ws'
Package is not installed or incorrect path.
fix
Run 'npm install ssb-ws' in your project directory.
TypeError: sbot.ws is undefined
ssb-ws plugin not properly loaded into sbot.
fix
Ensure you call .use(require('ssb-ws')) before accessing sbot.ws.
Upgrade
Version history
6.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
packagessb-ws
ssb-ws — npm install ssb-ws · libregistry