websockets/ws
46.0
Weak · 15 November 2026
4.9k
lines of production code
JavaScript
primary language
5
measurements over time
What this system is
Features
Add Express session parsing example
Added a new example demonstrating how to parse Express sessions within WebSocket upgrade requests. The example includes a Node.js server that uses the \express-session\ middleware to validate user sessions before establishing a WebSocket connection, along with a client-side HTML and JavaScript interface for simulating login, logout, and messaging.
examples/express-session-parse · high confidence
Add server-stats example demonstrating memory usage monitoring
A new example named 'server-stats' has been added to the examples directory. It provides a complete demonstration of using the WebSocket library to stream Node.js process memory usage (RSS, Heap total, Heap used, External) from a server to a browser client in real-time.
examples/server-stats · high confidence
Added SSL WebSocket example
A new example file (examples/ssl.js) demonstrates how to run WebSocket connections over SSL/TLS using Node.js's https module. It shows creating an HTTPS server with self-signed certificates, initializing a WebSocketServer on that HTTPS server, and configuring the client to connect via wss:// with rejectUnauthorized set to false to handle the self-signed certificate.
examples · high confidence
Behavioural changes
Library restructured with ES module wrapper and browser shim
The library now provides an ES module wrapper (wrapper.mjs) for modern import syntax and a browser shim (browser.js) that throws an error to prevent usage in browsers, directing users to the native WebSocket object. The main entry point (index.js) has been updated to expose internal classes like Receiver, Sender, and PerMessageDeflate as static properties on the WebSocket object, and the legacy Makefile has been removed in favor of npm scripts.
(repo-wide) · high confidence
Major overhaul of WebSocket internals and API
The library has been significantly refactored to modernize its architecture and improve performance. Key changes include the introduction of a \createWebSocketStream\ utility to wrap WebSockets in Node.js Duplex streams, the addition of \autoPong\ and \closeTimeout\ options for server configuration, and the implementation of a custom \EventTarget\ interface with \addEventListener\ support. Performance is enhanced through optimized buffer handling in \buffer-util\, stricter validation of subprotocols and extensions, and the use of \FastBuffer\ to reduce allocations. Additionally, the library now supports \Blob\ objects for binary data, allows \URL\ instances in the constructor, and drops support for older Node.js versions.
lib · high confidence
Test coverage
Added SSL/TLS test fixtures; Added WebSocket performance benchmarks for parser, sender, and throughput; Initial test suite for the ws library.
Dependencies
Major version 8.22.0 release with ES module support and modernized tooling
The library has been updated to version 8.22.0, introducing an ES module wrapper (\wrapper.mjs\) and explicit package exports to support modern bundlers and import systems. Node.js support is now restricted to version 10.0.0 and above, dropping older runtime compatibility. The development environment has been significantly upgraded, moving to ESLint 10, Prettier 3, Mocha 8, and NYC 15 for testing and linting. Additionally, \bufferutil\ and \utf-8-validate\ are now declared as optional peer dependencies with explicit \allowScripts\ permissions, and example projects for Express session parsing and server stats have been added.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 47 → 46 (-1.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 38 → 35 (-2.7)
- Architecture 100 → 100 (+0.0)
- Maturity 57 → 57 (-0.1)
- Readiness 41 → 41 (-0.0)
- Security 70 → 69 (-1.0)
- Performance 85 → 85 (+0.0)
Resolved (5)
- Off-boarding risk: anonymized user #1
- Rotate the exposed credentials — git history can't be un-committed
- Scanner failed to run — not a clean result
- Scanner failed to run — not a clean result
- Secret: generic-api-key (lib/Wetsock.js)
New (3)
- Off-boarding risk: anonymized user #1
- Skipped (documented): fails if the Upgrade header cannot be read (test/websocket.test.js)
- doc comments repeat the names (lib/event-target.js)
Changes since last survey
- 18 commits — 13 feature/other, 5 fixes
By area
- (root) — 6 commits
- lib/websocket.js — 5 commits
- .github/workflows — 1 commit
- doc/ws.md — 1 commit
- lib/buffer-util.js — 1 commit
- lib/permessage-deflate.js — 1 commit
- lib/receiver.js — 1 commit
- test/duplex-pair.js — 1 commit
- test/websocket.test.js — 1 commit
Notable commits
- fix: [fix] Do not mask a SharedArrayBuffer in place (#2358)
- fix: [fix] Do not modify the url.URL object (#2353)
- fix: [fix] Emit errors thrown while creating the redirect request (#2359)
- fix: [fix] Percent-decode the userinfo of the URL (#2352)
- fix: [fix] Reject non-decimal window bits values (#2355)
- change: [ci] Test on node 27
- change: [dist] 8.22.1
- change: [dist] 8.22.2
- change: [dist] 8.23.0
- change: [doc] Add missing parameter names to JSDoc comments (#2356)
- change: [doc] Adjust Node.js version requirement in README (#2348)
- change: [minor] Use http.websocket{M,Unm}ask() if possible (#2347)
- change: [perf] Do not retain the read buffer via the close reason (#2354)
- change: [perf] Do not retain the read buffer via the frame mask (#2350)
- change: [security] Add latest vulnerability to SECURITY.md
- change: [security] Limit automatically sent pending pongs
- change: [test] Ensure DuplexSockets automatically emit the 'close' event
- change: [test] Skip test on Node.js versions where it does not apply (#2340)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
websockets/ws was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit fc667e495bd63052ac78fc2a149dbf948d1d3d02 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.