A pool of WebSocket connections with automatic reconnection and load balancing. Version 1.3.2 is the current stable release, with no new releases since 2019. It allows distributing messages across multiple WebSocket servers using a pluggable scheduler (e.g., round-robin). Supports any WebSocket implementation (native or `ws`). Different from `reconnecting-websocket` which handles a single connection, and `generic-pool` which requires custom adaptation. Node.js >=6. ISC license.
npm install websocket-poolNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket pool with round-robin scheduling and two connections, sends a message on open, logs incoming messages, and closes the pool.
Bind to 'open' event after adding URLs.
Check the scheduler implementation against https://github.com/derhuerst/abstract-scheduler.
Update to use `createPool(WebSocket, scheduler)` instead of `createPool(WebSocket.prototype, scheduler)`.
If you need per-connection customization, consider using a different library or forking.
Use `ws@6` or test compatibility with your version.
Use `const createPool = require('websocket-pool');` or enable `esModuleInterop` in tsconfig.Pass a valid scheduler factory, e.g., `createRoundRobin` from '@derhuerst/round-robin-scheduler'.
Ensure `createPool` returned a valid pool object. Check import syntax.