Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
Is it possible to create a websocket connection somehow from an HTTPS-origin javascript webpage to another cross-origin WS server?

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!