Skip to content
pubscout

dart_frog_web_socket

1.0.3, released a year ago by dart-frog.dev

WebSocket support for the Dart Frog backend framework.

Quiet but busy
$ flutter pub add dart_frog_web_socket
Source repository

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.

  • mqtt5_client

    A server and browser based MQTT Version 5 client for Dart supporting TCP and WebSockets.

  • relic

    Lightweight web server framework inspired by Shelf, with typed APIs and a high‑performance native Zig adapter.

  • mqtt_client

    A Dart MQTT client supporting TCP, WebSocket, secure connections and all QoS levels.

Works with

Packages commonly used together with dart_frog_web_socket: ones it builds on, ones built on it, and its own family.