commit | 6d6c2c18f253a9146dade367a1ada9cd93387275 | [log] [tgz] |
---|---|---|
author | Natalie Weizenbaum <nweiz@google.com> | Mon Feb 01 19:51:42 2016 |
committer | Natalie Weizenbaum <nweiz@google.com> | Mon Feb 01 19:51:42 2016 |
tree | 71c495d8fc657cd788fc25f940f3891d32acea9b | |
parent | 7065619f5be627e8b82ef8962a1bf4f02ff1af53 [diff] |
Update the SDK constraint. This allows us to use ^ constraints. R=kevmoo@google.com Review URL: https://codereview.chromium.org//1646943003 .
shelf_web_socket
is a Shelf handler for establishing WebSocket connections. It exposes a single function, webSocketHandler, which calls an onConnection
callback with a CompatibleWebSocket object for every connection that's established.
import 'package:shelf/shelf_io.dart' as shelf_io; import 'package:shelf_web_socket/shelf_web_socket.dart'; void main() { var handler = webSocketHandler((webSocket) { webSocket.listen((message) { webSocket.add("echo $message"); }); }); shelf_io.serve(handler, 'localhost', 8080).then((server) { print('Serving at ws://${server.address.host}:${server.port}'); }); }