A pure JavaScript implementation of the WebSocket protocol (RFC 6455) for Node.js, supporting protocol versions 8 and 13. Current stable version is 1.0.8, released in 2012. The library includes both client and server implementations. Key differentiators: native modules are optional (fallback to JS), supports Autobahn test suite, and is one of the fastest WebSocket libraries for Node.js. Note: This package was originally published as non-native-websocket but is the precursor to the widely-used 'websocket' npm package by the same author.
npm install non-native-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a WebSocket server and client using the library, handling connection requests, messages, and errors.
No action required unless you need strict UTF-8 validation; then ensure native build tools (node-gyp) are installed or use a newer version of the library (e.g., 'websocket' package).
Upgrade to Node v0.8+ or use a newer library version that does not have this restriction.
Migrate to the 'websocket' package for continued support and updates.
For legacy browser support, see https://gist.github.com/1428579 or use a polyfill.
Use the 'websocket' package instead: npm install websocket
Install native build dependencies or use version >=1.0.7 where native modules are optional.
Ensure you call sendUTF on the connection object received in the 'connect' event.