File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 22
33` shelf_web_socket ` is a [ Shelf] [ ] handler for establishing [ WebSocket] [ ]
44connections. It exposes a single function, [ webSocketHandler] [ ] , which calls an
5- ` onConnection ` callback with a [ CompatibleWebSocket ] [ ] object for every
5+ ` onConnection ` callback with a [ WebSocketChannel ] [ ] object for every
66connection that's established.
77
88[ Shelf ] : https://pub.dartlang.org/packages/shelf
99
1010[ WebSocket ] : https://tools.ietf.org/html/rfc6455
1111
12- [ webSocketHandler ] : https://api .dartlang.org/apidocs/channels/be/dartdoc-viewer/ shelf_web_socket/shelf_web_socket. webSocketHandler
12+ [ webSocketHandler ] : https://pub .dartlang.org/documentation/shelf_web_socket/latest/ shelf_web_socket/webSocketHandler.html
1313
14- [ CompatibleWebSocket ] : https://api .dartlang.org/apidocs/channels/be/dartdoc-viewer/http_parser/http_parser.CompatibleWebSocket
14+ [ WebSocketChannel ] : https://pub .dartlang.org/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html
1515
1616``` dart
1717import 'package:shelf/shelf_io.dart' as shelf_io;
1818import 'package:shelf_web_socket/shelf_web_socket.dart';
19+ import 'package:web_socket_channel/web_socket_channel.dart';
1920
2021void main() {
2122 var handler = webSocketHandler((webSocket) {
2223 webSocket.stream.listen((message) {
23- webSocket.add("echo $message");
24+ webSocket.sink. add("echo $message");
2425 });
2526 });
2627
You can’t perform that action at this time.
0 commit comments