sse_channel 0.2.2 copy "sse_channel: ^0.2.2" to clipboard
sse_channel: ^0.2.2 copied to clipboard

StreamChannel wrappers for Server Sent Events.

example/main.dart

import 'package:sse_channel/sse_channel.dart';

Future<void> main() async {
  final url = Uri.parse('http://localhost:8080/sse');
  final channel = SseChannel.connect(url);

  await channel.ready;

  channel.stream.listen((message) {
    channel.sink.add('received!');
    channel.sink.close(1, "close reason");
  });
}
11
likes
150
points
41.8k
downloads

Publisher

verified publisherjamiewest.dev

Weekly Downloads

StreamChannel wrappers for Server Sent Events.

Repository
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, http, logging, pool, sse, stream_channel, uuid, web

More

Packages that depend on sse_channel