From f3f67e6dbca7c840ddfd44388a74356a511f208e Mon Sep 17 00:00:00 2001 From: Wouter van der Waal Date: Tue, 12 Aug 2025 13:10:02 +0200 Subject: [PATCH] Added wsProtocols prop to VncConsole --- packages/module/src/components/VncConsole/VncConsole.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/module/src/components/VncConsole/VncConsole.tsx b/packages/module/src/components/VncConsole/VncConsole.tsx index 71f9ae9..479244e 100644 --- a/packages/module/src/components/VncConsole/VncConsole.tsx +++ b/packages/module/src/components/VncConsole/VncConsole.tsx @@ -48,6 +48,8 @@ export interface VncConsoleProps extends React.HTMLProps { credentials?: object; /** A DOMString specifying the ID to provide to any VNC repeater encountered */ repeaterID?: string; + /** An Array of DOMStrings specifying the sub-protocols to use in the WebSocket connection */ + wsProtocols?: string[]; /** log-level for noVNC */ vncLogging?: 'error' | 'warn' | 'none' | 'debug' | 'info'; consoleContainerId?: string; @@ -88,6 +90,7 @@ export const VncConsole: React.FunctionComponent = ({ shared = false, credentials, repeaterID = '', + wsProtocols = [], vncLogging = 'warn', consoleContainerId, additionalButtons = [] as React.ReactNode[], @@ -157,7 +160,8 @@ export const VncConsole: React.FunctionComponent = ({ const options = { repeaterID, shared, - credentials + credentials, + wsProtocols }; rfb.current = new RFB(novncElem.current, url, options); addEventListeners(); @@ -180,7 +184,8 @@ export const VncConsole: React.FunctionComponent = ({ rfb, repeaterID, shared, - credentials + credentials, + wsProtocols ]); useEffect(() => {