diff --git a/src/interop_web.js b/src/interop_web.js index efb7cb7ab..0c993fb21 100644 --- a/src/interop_web.js +++ b/src/interop_web.js @@ -522,7 +522,9 @@ mergeInto(LibraryManager.library, { // create the actual websocket object and connect try { var parts = addr.split('/'); - var url = 'ws://' + parts[0] + ":" + port + "/" + parts.slice(1).join('/'); + var proto = _interop_IsHttpsOnly() ? 'wss://' : 'ws://'; + var url = proto + parts[0] + ":" + port + "/" + parts.slice(1).join('/'); + ws = new WebSocket(url, 'ClassiCube'); ws.binaryType = 'arraybuffer'; } catch (e) {