bolt_websocket_binding 0.1.0-dev.2 copy "bolt_websocket_binding: ^0.1.0-dev.2" to clipboard
bolt_websocket_binding: ^0.1.0-dev.2 copied to clipboard

Provides bi-directional WebSocket Bindings for Bolt

bolt logo

Provides bi-directional WebSocket Bindings for Bolt

pub package bolt coverage style: very good analysis License: MIT


Quick Start 🚀 #

Prerequisites 📝 #

In order to start using the WebSocket bindings for Bolt you must have the Dart SDK installed on your machine.

Installing 🧑‍💻 #

Add bolt_websocket_binding to your pubspec.yaml:

# 📦 Install bolt_websocket_binding from pub.dev
dart pub add bolt_websocket_binding

Add the binding to a Server 🏁 #

Add the WebSocketServerBinding to the list of bindings of your server:

import 'package:bolt/bolt.dart';
import 'package:bolt/server.dart';
import 'package:bolt_websocket_binding/bolt_websocket_binding.dart';

class ExampleServer extends BoltServer {
  ExampleServer(
    Address address, {
    super.logger,
  }) : super(bindings: [WebSocketServerBinding(address, logger: logger)]);

  ...

}

Add the binding to a Client ✨ #

Pass the WebSocketClientBinding to the binding of your client:

import 'package:bolt/bolt.dart';
import 'package:bolt/client.dart';
import 'package:bolt_websocket_binding/bolt_websocket_binding.dart';

class ExampleClient extends BoltClient {
  ExampleClient({
    super.logger,
    required super.server,
  }) : super(binding: WebSocketClientBinding(server, logger: logger));

  ...

}
0
likes
130
pub points
0%
popularity

Publisher

verified publisherwolfenra.in

Provides bi-directional WebSocket Bindings for Bolt

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

bolt, web_socket_channel

More

Packages that depend on bolt_websocket_binding