I am developing a websocket server (let's call it WS), which is totally independent from another HTTPS server which I am also developing (let's call it Main).
WS itself is working well and I also have a command line testing tool which is written in Node.JS that can communicate with WS via websocket messages.
Main itself is also working well and I can open web pages with browsers via HTTPS without any problem.
Here's the problem:
Since command-line testing is not user-friendly to engineers that are not familiar with command lines, I want to create a "Browser Webpage Testing Tool" on Main in order to send messages to WS and receive response.
I basically used codes from here: https://blog.teamtreehouse.com/an-introduction-to-websockets#:~:text=To%20send%20a%20message%20through,binary%20data%20through%20a%20WebSocket.
However on this line
// Create a new WebSocket.
var socket = new WebSocket('ws://Ws-address');
The browser tells me "The page at 'https://MainUrl/testing-tool' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://Ws-address/'. This request has been blocked; this endpoint must be available over WSS."
However the WS server is a real time application and is not intended to work over wss, rather as a requirement it must be optimized in speed as much as possible and anything else must be sacrificed.
Therefore WS will use plain ws instead of wss which has an additional tls handshake.
Is there any way to make my "Testing Tool" work?