commit | 338873af12986be26cf2743c13564531bb8677ba | [log] [tgz] |
---|---|---|
author | BC Ko <bcko@users.noreply.github.com> | Thu May 24 12:46:33 2018 -0700 |
committer | GitHub <noreply@github.com> | Thu May 24 12:46:33 2018 -0700 |
tree | 27c54b78c4a6ca81d2d9ea398241d64633335325 | |
parent | 107c31292fa1c7d39231943ed8a1fb827c53e452 [diff] |
Update .gitignore to new `dart_tool` pub cache dart-lang/sdk#32030
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}'); }); }