Overview of the internal WebSocket implementation
masterThe project uses a custom fork of the Gorilla WebSocket library, specifically adapted for Centrifuge's requirements. Key differences from the original Gorilla implementation include:
- Optimized Upgrades: Reduced allocations (from 9 down to 3) during the upgrade process.
- HTTP/2 Support: Supports WebSocket over HTTP/2 (RFC 8441) on the server side.
- Subprotocol Handling: The selected subprotocol is not stored internally; instead, it is returned during the
UpgradeorDialoperations. - Client Changes: The
Clientno longer uses a customProxy. - Concurrency: Concurrent use detection is handled on a best-effort basis.
- Handlers: It is not possible to set a custom
CloseHandler. - Linting: Includes various lint fixes for the Centrifuge environment.