How to pass Authentication Header in Flutter WebSocketChannel?

Viewed 135

I'm using Flutter web_socket_channel package to communicate with server. The class WebSocketChannel doesn't take a header parameter.

factory WebSocketChannel.connect(Uri uri, {Iterable<String>? protocols}) =>
      platform.connect(uri, protocols: protocols);

When using IOWebSocketChannel to pass header, I'm getting Unsupported operation: Platform._version in web like given here. It is working fine in Android and iOS.

0 Answers
Related