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

236
Views
NodeJS No se puede conectar al origen Websocket Cross - "Err 1006"

Tengo dos servidores web que ejecutan https con los mismos certificados, tengo un fragmento principal que el usuario conecta a example.com, recuperan algunos datos e intentan conectarse a una dirección IP en el segundo fragmento a través de websocket.

Pero no importa lo que configure, obtengo un error 1006 en el lado del cliente cuando me conecto al segundo fragmento. Firefox devtooling me da varios errores: ssl_error_bad_cert_domain, SSL_ERROR_RX_RECORD_TOO_LONG.

Los certificados están emitidos y firmados, me preguntaba a dónde debería ir desde aquí. Gracias :)

fragmento2

 const options = { key: './server.key', cert: './server.cert' }; var https = require('https').Server(options); https.listen(443, function () { // console.log('Https listening on *: 443'); }); let WebSocket = require('ws'); let socket = new WebSocket.Server({ server:https }); socket.on('connection', function (ws, req) { ws.on('message', (msgRaw) =>{ }); ws.on('close', function(code, reason) { }); ws.on('error', function(error) { console.log(error); ws.close(); }); });

CLIENTE

 function connect() { "use strict"; window.WebSocket = window.WebSocket || window.MozWebSocket; if (!window.WebSocket) { alert('Your browser doesn\'t support WebSocket'); return; } wss = new WebSocket('wss://123.123.123.120/:443'); wss.onmessage = function(event) { }; wss.onerror = function(event) { console.log(`wss error: ${JSON.stringify(event)}`); }; wss.onclose = function(event) { }; }

¿Diagrama de sistema útil?

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!