Registry / messaging / meshblu-server-websocket

meshblu-server-websocket

JSON →
library1.5.2jsnpmunverified

WebSocket protocol adapter for Meshblu (Octoblu IoT platform). Version 1.5.2, last updated November 2016. Provides a WebSocket interface for Meshblu devices to communicate, authenticate, and exchange messages. Deprecated as Octoblu platform is no longer maintained. Suitable legacy usage only.

npm install meshblu-server-websocket
INSTALL
IMPORT
SIG · MESHBLU-SERVER-WEB
M
meshblu-server-websocket
messagingjavascriptv1.5.2
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.

createServer
import { createServer } from 'meshblu-server-websocket'
var meshblu = require('meshblu-server-websocket')
Library supports both ESM and CJS; CJS require works but may not provide named exports reliably in older versions.
MeshbluWebsocketServer
import MeshbluWebsocketServer from 'meshblu-server-websocket'
const MeshbluWebsocketServer = require('meshblu-server-websocket').default
Default export is available; avoid .default in CJS unless using esModuleInterop.
types
import type { WebSocketServerOptions } from 'meshblu-server-websocket'
import { WebSocketServerOptions } from 'meshblu-server-websocket'
Type imports required for TypeScript; the package does not ship its own types, so use @types/meshblu if available, or declare module.

Creates a WebSocket server attached to a Meshblu instance, handling incoming messages.

import { createServer } from 'meshblu-server-websocket'; import { Meshblu } from 'meshblu'; const meshblu = new Meshblu({ server: 'localhost', port: 3000 }); const wss = createServer({ meshblu, port: 8080 }, () => { console.log('WebSocket server listening on port 8080'); }); wss.on('connection', (ws, req) => { ws.on('message', (data) => { const message = JSON.parse(data); console.log('Received:', message); ws.send(JSON.stringify({ status: 'OK' })); }); });
Debug
Known issues
deprecatedThe entire Octoblu platform is deprecated; meshblu-server-websocket has not been updated since 2016.
fix
Migrate to alternative IoT messaging platforms like AWS IoT, MQTT.js, or WebSocket servers using ws library directly.
affects: >=0.0.0
gotchaThe library expects a Meshblu instance; without it, the server will not function correctly.
fix
Ensure meshblu is installed and properly configured before instantiating this server.
affects: >=1.0.0
gotchaEven with @types/meshblu-websocket-server, type definitions may be missing or incomplete.
fix
Use TypeScript's declare module to augment types or use JSDoc for type checking.
affects: >=1.0.0
Errors
Common errors & fixes
Meshblu is not defined
Invalid or missing Meshblu instance passed to createServer.
fix
Install meshblu package and ensure it is instantiated with correct server and port.
Cannot find module 'meshblu-server-websocket'
Module not installed or global install not recognized.
fix
Run 'npm install meshblu-server-websocket' in your project root.
TypeError: createServer is not a function
Incorrect import method (library may export default instead of named export).
fix
Use default import: import createServer from 'meshblu-server-websocket'
Upgrade
Version history
1.5.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
meshblu-server-websocket — npm install meshblu-server-websocket · libregistry