zaptools_server 0.3.0 copy "zaptools_server: ^0.3.0" to clipboard
zaptools_server: ^0.3.0 copied to clipboard

A toolkit for Event-Driven websocket management.

example/zaptools_server_example.dart

import 'package:zaptools_server/zaptools_server.dart';

void main() async {
  final app = ZapServer();

  app.onConnected((contexts) {
    print('client connected');
  });

  app.onDisconnected((context) {
    print('client disconnected!');
  });

  app.onEvent('hello', (context) {
    context.connection.send('bye', 'see ya!');
  });

  final server = await app.start();
  print('listen on -> ${server.port}');
}
3
likes
130
pub points
3%
popularity
screenshot

Publisher

unverified uploader

A toolkit for Event-Driven websocket management.

Repository (GitHub)
View/report issues

Topics

#server #websocket

Documentation

API reference

License

MIT (license)

Dependencies

uuid, web_socket_channel

More

Packages that depend on zaptools_server