getRelayWebSocket method
Returns the WebSocket registered with the given relayUrl
.
Implementation
WebSocketChannel? getRelayWebSocket({
required String relayUrl,
}) {
final targetWebSocket = relaysWebSocketsRegistry[relayUrl];
if (targetWebSocket != null) {
final relay = targetWebSocket;
return relay;
} else {
utils.log(
'No relay is registered with the given url: $relayUrl, did you forget to register it?',
);
throw RelayNotFoundException(relayUrl);
}
}