Registry / messaging / noflo-websocket

noflo-websocket

JSON →
library0.4.0jsnpmunverified

Provides WebSocket client and server components for the NoFlo flow-based programming environment. Version 0.4.0 (February 2018) supports Node.js and browsers, with basic authentication for Node.js clients. Components include OpenConnection, SendMessage, and ReceiveMessage. It uses the ws library on Node.js and the native WebSocket API in browsers. Last updated in 2018, with no further releases; primarily for legacy NoFlo projects.

npm install noflo-websocket
INSTALL
IMPORT
SIG · NOFLO-WEBSOCKET
N
noflo-websocket
messagingjavascriptv0.4.0
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.

OpenConnection
import { OpenConnection } from 'noflo-websocket'
const OpenConnection = require('noflo-websocket').OpenConnection
ESM or CommonJS both work; Webpack/browserify may require special handling for ws dependency.
SendMessage
import { SendMessage } from 'noflo-websocket'
const sm = require('noflo-websocket').SendMessage
Check component name casing; known as 'SendMessage' in the source.
ReceiveMessage
import { ReceiveMessage } from 'noflo-websocket'
import { receiveMessage } from 'noflo-websocket'
Component names are PascalCase.

Shows how to load noflo-websocket components and wire them in a NoFlo graph.

const noflo = require('noflo'); const { OpenConnection, SendMessage, ReceiveMessage } = require('noflo-websocket'); // Create a graph that connects to a WebSocket server and sends a message const graph = new noflo.Graph('test'); graph.addNode('open', 'noflo-websocket/OpenConnection'); graph.addNode('send', 'noflo-websocket/SendMessage'); graph.addNode('receive', 'noflo-websocket/ReceiveMessage'); // Wire: connect websocket to send and receive graph.addEdge('open', 'out', 'send', 'in'); graph.addEdge('open', 'out', 'receive', 'in'); // receive also needs connection // Provide URL to open connection graph.addInitial('wss://example.com/socket', 'open', 'url'); graph.addInitial('Hello', 'send', 'message'); // Run the graph noflo.createNetwork(graph, (err, network) => { if (err) return console.error(err); network.start(); }); // In browser, load via noflo's component loader.
Debug
Known issues
breakingSendMessage now uses a 'control' port instead of internal state; existing graphs may break if they depend on earlier behavior.
fix
Update graph to wire a signal to the 'control' port to trigger send, or upgrade to 0.4.0 and adjust.
affects: <=0.3.0
deprecatedThe package is unmaintained since 2018; no updates for WebSocket protocol changes or security fixes.
fix
Consider migrating to a maintained alternative like 'ws' directly or 'socket.io' for active projects.
affects: *
gotchaComponent names are case-sensitive and must match exactly (e.g., 'OpenConnection', 'SendMessage').
fix
Use import with exact PascalCase names as exported.
affects: >=0.4.0
gotchaIn browser, the 'ws' module is not used; instead native WebSocket API. Ensure you are not bundling ws for browser.
fix
Use webpack resolve alias or conditional require to avoid bundling ws in browser context.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'noflo-websocket'
Package not installed or path incorrect.
fix
npm install noflo-websocket --save
TypeError: Cannot read property 'send' of undefined
SendMessage used without properly opening a WebSocket connection first, or missing 'control' port signal in 0.4.0.
fix
Ensure OpenConnection node is wired and connected, and provide a signal to SendMessage's 'control' port.
UnhandledPromiseRejectionWarning: Error: Invalid URL
URL provided to OpenConnection is malformed or missing protocol.
fix
Use a valid WebSocket URL (e.g., 'wss://example.com/socket').
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
noflorequiredNoFlo runtime required to use components
wsoptionalWebSocket server implementation on Node.js
Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
noflo-websocket — npm install noflo-websocket · libregistry