Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

296
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda