{"id":49739,"library":"websocket.io","title":"websocket.io","description":"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.","status":"deprecated","version":"0.2.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install websocket.io","lang":"bash","label":"npm"},{"cmd":"yarn add websocket.io","lang":"bash","label":"yarn"},{"cmd":"pnpm add websocket.io","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is CommonJS only; ES modules are not supported.","wrong":"import ws from 'websocket.io'","symbol":"default","correct":"const ws = require('websocket.io')"},{"note":"Though destructuring works in many environments, the package's export is a function with attached properties; require() the whole module.","wrong":"const { Server } = require('websocket.io')","symbol":"Server","correct":"const Server = require('websocket.io').Server"},{"note":"Access via top-level export; no separate import path.","symbol":"Socket","correct":"const Socket = require('websocket.io').Socket"}],"quickstart":{"code":"const ws = require('websocket.io');\nconst server = ws.listen(3000);\nserver.on('connection', (client) => {\n  client.on('message', (data) => console.log('Received:', data));\n  client.on('close', () => console.log('Client disconnected'));\n  client.send('Hello from websocket.io');\n});\nconsole.log('WebSocket server listening on port 3000');","lang":"javascript","description":"Creates a standalone WebSocket server on port 3000 and handles connection, message, and close events."},"warnings":[{"fix":"Migrate to modern WebSocket libraries such as 'ws', 'uWebSockets.js', or 'socket.io' (v2+).","message":"websocket.io is deprecated and no longer maintained.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Use a newer library compatible with your Node.js version (e.g., 'ws' for Node >=6).","message":"Targets Node 0.6 only; may not work on modern Node.js versions.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use CommonJS require() or wrap with dynamic import() if necessary.","message":"The library does not support ES modules; using import instead of require will fail.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'-75':21 '0.6':52 '2012':48 '6455':24 'attach':31 'deprec':40 'draft':20 'extract':11 'http':35 'javascript':64 'last':45 'librari':9,59 'like':60 'minimalist':6 'mode':32 'modern':57 'multipl':16 'node':51 'node.js':34 'origin':10 'packag':38 'protocol':18 'provid':26 'publish':46 'rfc':23 'server':8,29,36 'socket.io':13 'standalon':28 'supersed':55 'support':15 'target':50 'unmaintain':42 'uwebsockets.js':63 'v0.2.1':3 'version':19 'websocket':7,17,58 'websocket.io':1,2 'ws':61","created_at":"2026-06-07T17:03:21.579050+00:00","updated_at":"2026-06-07T17:03:21.579050+00:00","problems":[{"fix":"Run: npm install websocket.io (though it's deprecated; consider alternatives).","cause":"Package not installed.","error":"Error: Cannot find module 'websocket.io'"},{"fix":"Use const ws = require('websocket.io');.","cause":"Importing incorrectly (e.g., using default import with ES modules).","error":"TypeError: ws.listen is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"websocket.io","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}