spry_websocket 1.0.0 copy "spry_websocket: ^1.0.0" to clipboard
spry_websocket: ^1.0.0 copied to clipboard

discontinuedreplaced by: spry

Spry WebSocket is a Spry handler for handling WebSocket requests.

example/main.dart

import 'package:spry/spry.dart';
import 'package:spry_websocket/spry_websocket.dart';

void onConnection(Context context, WebSocketChannel channel) {
  channel.stream.listen((event) {
    channel.sink.add('Server received: $event');
  });
}

final spry = Spry();
final websocket = SpryWebSocket(onConnection);

void main() async {
  await spry.listen(websocket, port: 3030);

  print('🎉 Server is running at ws://localhost:3030');
}
0
likes
90
points
2
downloads

Publisher

verified publisherodroe.com

Weekly Downloads

Spry WebSocket is a Spry handler for handling WebSocket requests.

Documentation

API reference

License

MIT (license)

Dependencies

meta, spry, stream_channel, web_socket_channel

More

Packages that depend on spry_websocket