Node.js的開源、多進程實時WebSocket引擎:SocketCluster
SocketCluster是一個快速,高度可擴展的HTTP+實時服務器引擎,它可以讓你建立多進程實時服務器,利用在機器/實例上所有的CPU核心。它消除了運行您的Node.js服務器作為單一線程的限制。SocketCluster支持直接客戶端 - 服務器通信(如Socket.io),和通過發布/訂閱頻道群組通信。
- Resilient on both the client and backend - Process crashes, lost connections and other failures are handled seamlessly.
- Scales linearly as you add more CPU cores and workers (assuming a decent OS) - Tested with up to 16 cores.
- Also designed to scale horizontally across multiple machines. See sc-redis sample.
- Support for both pub/sub channels and standard WebSocket client-server interactions (via events).
- Channels offer a clean way to allow multiple browser tabs to share the same realtime data.
- Authentication engine compliant with JSON Web Token (JWT).
- Authorization via middleware functions (access control for emit, publish in, publish out, subscribe and handshake interactions).
- Client sockets automatically reconnect (by default) if they lose the connection.
- SocketCluster v2 early release (stable) is a pure WebSocket (no hack) solution.
- Errors across all processes are caught and logged on master by default.
- Designed to work alongside any database/datastore (Redis, MySql, PostgreSQL, MongoDB, Cassandra, etc...).
- Open source alternative to PubNub and Pusher.
- Can be used as an open source Firebase alternative when integrated with a database of your choice (with some extra work). </ul> </div>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!