websocketHost property

Future<String> websocketHost

Full host name of the web socket endpoint. E.g. "wss://example.com/websocket"

Implementation

Future<String> get websocketHost async {
  var uri = Uri.parse(host);
  if (uri.scheme == 'http') {
    uri = uri.replace(scheme: 'ws');
  } else if (uri.scheme == 'https') {
    uri = uri.replace(scheme: 'wss');
  }
  uri = uri.replace(path: '/websocket');

  if (authenticationKeyManager != null) {
    var auth = await authenticationKeyManager!.get();
    if (auth != null) {
      uri = uri.replace(
        queryParameters: {
          'auth': auth,
        },
      );
    }
  }
  return uri.toString();
}