Open anjojy opened 3 years ago
As stated in this answer, apparently the use of authorization HTTP headers is not the intended way to perform authentication in the web socket protocol. Suggested alternatives are:
Use IOWebSocketChannel
instead of WebSocketChannel.connect
_channel = IOWebSocketChannel.connect(
Uri.parse(Constants.connectionUrl),
headers: Headers.getHeaderParameters(),
);
try this: https://stackoverflow.com/a/41521871 . It is good for you
can't pass authentication cookie when create `channel
final _channel = WebSocketChannel.connect(Uri.parse('URL'));