Index: lib/src/web_socket_handler.dart |
diff --git a/lib/src/web_socket_handler.dart b/lib/src/web_socket_handler.dart |
index b8f94a239a59134c760513c10646f92c129817c0..73dcfef30c63106107a553763a25db1b889c6652 100644 |
--- a/lib/src/web_socket_handler.dart |
+++ b/lib/src/web_socket_handler.dart |
@@ -5,6 +5,7 @@ |
import 'dart:convert'; |
import 'package:shelf/shelf.dart'; |
+import 'package:stream_channel/stream_channel.dart'; |
import 'package:web_socket_channel/web_socket_channel.dart'; |
/// A class that exposes a handler for upgrading WebSocket requests. |
@@ -64,7 +65,9 @@ class WebSocketHandler { |
} |
var protocol = _chooseProtocol(request); |
- request.hijack((channel) { |
+ request.hijack((untypedChannel) { |
+ var channel = (untypedChannel as StreamChannel).cast/*<List<int>>*/(); |
+ |
var sink = UTF8.encoder.startChunkedConversion(channel.sink); |
sink.add( |
"HTTP/1.1 101 Switching Protocols\r\n" |