in src/SignalingClient.ts [198:211]
private sendMessage(action: MessageType, messagePayload: object, recipientClientId?: string): void {
if (this.readyState !== ReadyState.OPEN) {
throw new Error('Could not send message because the connection to the signaling service is not open.');
}
this.validateRecipientClientId(recipientClientId);
this.websocket.send(
JSON.stringify({
action,
messagePayload: SignalingClient.serializeJSONObjectAsBase64String(messagePayload),
recipientClientId: recipientClientId || undefined,
}),
);
}