signalr_client icon indicating copy to clipboard operation
signalr_client copied to clipboard

To use Authorize

Open cyberprophet opened this issue 1 year ago • 1 comments

If you want to use [Authorize], you can use IOWebSocketChannel instead of WebSocketChannel to pass Header.

_webSocket = IOWebSocketChannel.connect(Uri.parse(url), headers: {
      'Authorization':
          'Bearer ${_accessTokenFactory != null ? await _accessTokenFactory!() : ''}'
    });

It is also possible to transmit the entire header by slightly modifying the code in part lib/web_socket_transport.dart.

cyberprophet avatar Mar 01 '24 12:03 cyberprophet

If you want to use [Authorize], you can use IOWebSocketChannel instead of WebSocketChannel to pass Header.

cyberprophet avatar Mar 01 '24 12:03 cyberprophet