Registry / devops / websocket.io

websocket.io

JSON →
library0.2.1jsnpmunverified

websocket.io v0.2.1 is a minimalistic WebSocket server library originally extracted from Socket.IO. It supports multiple WebSocket protocol versions (draft-75 through RFC 6455) and provides a standalone server or attach mode for Node.js HTTP servers. The package is deprecated and unmaintained; it was last published in 2012 and targets Node 0.6. It is superseded by modern WebSocket libraries like ws or uWebSockets.js.

npm install websocket.io
INSTALL
IMPORT
SIG · WEBSOCKET.IO
W
websocket.io
devopsjavascriptv0.2.1
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('websocket.io')
✗ import ws from 'websocket.io'
The package is CommonJS only; ES modules are not supported.
Server
✓ const Server = require('websocket.io').Server
✗ const { Server } = require('websocket.io')
Though destructuring works in many environments, the package's export is a function with attached properties; require() the whole module.
Socket
✓ const Socket = require('websocket.io').Socket
Access via top-level export; no separate import path.

Creates a standalone WebSocket server on port 3000 and handles connection, message, and close events.

const ws = require('websocket.io'); const server = ws.listen(3000); server.on('connection', (client) => { client.on('message', (data) => console.log('Received:', data)); client.on('close', () => console.log('Client disconnected')); client.send('Hello from websocket.io'); }); console.log('WebSocket server listening on port 3000');
Debug
Known issues
deprecatedwebsocket.io is deprecated and no longer maintained.
fix
Migrate to modern WebSocket libraries such as 'ws', 'uWebSockets.js', or 'socket.io' (v2+).
affects: >=0.0.1
gotchaTargets Node 0.6 only; may not work on modern Node.js versions.
fix
Use a newer library compatible with your Node.js version (e.g., 'ws' for Node >=6).
affects: >=0.0.1
gotchaThe library does not support ES modules; using import instead of require will fail.
fix
Use CommonJS require() or wrap with dynamic import() if necessary.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'websocket.io'
Package not installed.
fix
Run: npm install websocket.io (though it's deprecated; consider alternatives).
TypeError: ws.listen is not a function
Importing incorrectly (e.g., using default import with ES modules).
fix
Use const ws = require('websocket.io');.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
websocket.io — npm install websocket.io · libregistry