dart_frog_web_socket
1.0.3, released a year ago by dart-frog.dev
WebSocket support for the Dart Frog backend framework.
What it does
Provides a webSocketHandler to manage WebSocket connections within Dart Frog route handlers. It allows streaming messages from clients and sending outgoing messages back via a channel sink.
AI-written summary of version 1.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a backend using Dart Frog and need WebSocket support
- You need to handle real-time, bi-directional communication between clients and a Dart Frog server
Skip it when
- You are not using the Dart Frog backend framework
- You only need standard HTTP REST endpoints without persistent connections
Strengths
- Seamlessly integrates with Dart Frog routing and handlers
- Straightforward API using standard channel stream and sink patterns
Weaknesses
- Tightly coupled to the Dart Frog framework
- Limited documentation outside of basic examples
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add dart_frog_web_socket to dependencies and use webSocketHandler in route handlers.
import 'package:dart_frog/dart_frog.dart';
import 'package:dart_frog_web_socket/dart_frog_web_socket.dart';
Handler get onRequest {
return webSocketHandler(
(channel, protocol) {
channel.stream.listen(
(message) {
channel.sink.add('pong');
},
);
},
);
}Alternatives
Packages that do the same job and could replace dart_frog_web_socket.
- angel3_websocket
WebSockets support and event broadcasting for the Angel3 framework.
77Compare - mqtt5_client
A server and browser based MQTT Version 5 client for Dart supporting TCP and WebSockets.
92Compare - relic
Lightweight web server framework inspired by Shelf, with typed APIs and a high‑performance native Zig adapter.
91Compare - mqtt_client
A Dart MQTT client supporting TCP, WebSocket, secure connections and all QoS levels.
91Compare
Works with
Packages commonly used together with dart_frog_web_socket: ones it builds on, ones built on it, and its own family.
- shelf_web_socketdart_frog_web_socket depends on itShelf handler that upgrades HTTP to WebSocket and provides a WebSocketChannel per connection.
- web_socket_channeldart_frog_web_socket depends on itCross‑platform WebSocket channel wrapper for Dart
- dart_frogdart_frog_web_socket depends on itA minimalistic Dart backend framework with a built‑in dev server and Docker support.
- dart_frog_lintSame familyProvides Dart Frog‑specific lint rules for static analysis.
- dart_frog_genSame familyCode generation tooling for Dart Frog backend applications.
- dart_frog_cliSame familyOfficial command-line interface for the Dart Frog backend framework.
- dart_frog_authSame familyOfficial authentication library and middleware for the Dart Frog backend server framework.