commit | 463a948386115861ed7fae887180fd01f5c26de6 | [log] [tgz] |
---|---|---|
author | Franklin Yow <58489007+franklinyow@users.noreply.github.com> | Thu Apr 01 00:25:08 2021 |
committer | GitHub <noreply@github.com> | Thu Apr 01 00:25:08 2021 |
tree | 1ec095b345ffcc8bc06ed8271b366acf82359b06 | |
parent | f7b3c3597a1d653bb9eac26e8963020a8da1079c [diff] |
Update LICENSE Changes to comply to internal review
shelf_web_socket
is a Shelf handler for establishing WebSocket connections. It exposes a single function, webSocketHandler, which calls an onConnection
callback with a WebSocketChannel 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'; import 'package:web_socket_channel/web_socket_channel.dart'; void main() { var handler = webSocketHandler((webSocket) { webSocket.stream.listen((message) { webSocket.sink.add("echo $message"); }); }); shelf_io.serve(handler, 'localhost', 8080).then((server) { print('Serving at ws://${server.address.host}:${server.port}'); }); }