ws
github.com
4
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
ws is the most popular and widely-adopted WebSocket implementation for Node.js, providing a simple yet powerful API for both WebSocket servers and clients. Created and maintained by Einar Otto Stangvik, this library has become the de facto standard WebSocket solution in the Node.js ecosystem, serving as the underlying transport layer for countless real-time applications including Socket.io, Primus, and numerous production systems at companies like Slack, Discord, and Trello. The library is designed with a focus on performance, reliability, and standards compliance: it fully implements RFC 6455 (The WebSocket Protocol) and supports all WebSocket extensions defined in the specification, including permessage-deflate for compression and client-to-server and server-to-client message fragmentation. Key features include a lightweight event-driven API (emitting connection, message, close, error, and ping/pong events), support for both text and binary message frames, automatic ping/pong heartbeat mechanism for connection health monitoring, configurable connection timeouts, broadcast capabilities for sending messages to all connected clients, TLS/SSL support for secure WSS connections, custom HTTP header injection during the WebSocket handshake, subprotocol negotiation, maximum payload size configuration, backpressure handling for slow consumers, and connection lifecycle management. The server component can be attached to an existing HTTP server or operate standalone, while the client component works seamlessly in Node.js environments. With over 21,000 GitHub stars and over 50 million weekly npm downloads, ws is trusted by the largest real-time platforms in the world. The library is licensed under the MIT license.
Statistics
4
Views
0
Clicks
0
Like
0
Dislike