websocket_core 1.2.1
websocket_core: ^1.2.1 copied to clipboard
Core WebSocket Backend for Dart — explicit, performant, no magic abstractions. Pure dart:io WebSocket with session management, reconnection, rooms and protocol versioning.
1.2.1 #
- Documentation:
- Updated README.md with improved examples for Auto-Reply and RPC.
- Fixed installation version instructions.
1.2.0 #
-
Major DX Improvements:
- Request-Response (RPC) Pattern: Added
client.request()method that returns aFuture. Clients can now await responses from the server, behaving like a standard HTTP call but over the persistent WebSocket connection. - Auto-Reply Handler: Server handlers can now return
Future<dynamic>(e.g., aMaporList). If a value is returned, the server automatically sends it back to the client as a response. This eliminates the need to manually constructWsMessagefor simple replies. - Controllers: Introduced
WsControllerabstract class andserver.registerController()to better organize route logic in larger applications.
- Request-Response (RPC) Pattern: Added
-
Client:
- Added
_pendingRequestsmanagement toWsClient. - Added internal
UuidGeneratorfor correlation IDs in requests. - Updated
WsClientto automatically match responses usingcorrelationId.
- Added
-
Server:
- Updated
WsHandlertypedef to allowdynamicreturn types. - Updated
WsDispatcherto process return values and automatically reply to the client using the incoming message'scorrelationId.
- Updated
-
Documentation:
- Added Lifecycle Diagram using MermaidJS to visualize Session vs Connection.
- Added Deployment Guide for Nginx and Docker.
- Added Error Codes reference table.
- Updated Cookbook with RPC and Controller examples.
1.1.0 #
- New Features:
- Detached Mode:
start(bindServer: false)allows usingWsServerwith external HTTP servers (likeshelfordart:io). - Added
handleRequest(HttpRequest)to manually process WebSocket upgrades.
- Detached Mode:
1.0.0 #
- Initial release of websocket_core.
- Core Features:
- Pure
dart:ioWebSocket transport (zero external dependencies). - Explicit connection and session management (
Session > Connectionmodel). - Protocol versioning support.
- Logical rooms system tracking sessions instead of sockets.
- Pluggable authentication interface.
- Configurable Heartbeat (ping/pong) and timeout detection.
- Robust reconnection handling with state preservation.
- Event Dispatcher with middleware support.
- Rate Limiting middleware for abuse protection.
- Typed exceptions for better error handling.
- Interfaces for scalability (Pub/Sub and Metrics logic).
- Pure