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

231
Vistas
How can I troubleshoot a minimalist web socket connection error?

I am using web sockets to connect to localhost as seen below. I am using native web sockets on the client and express-ws on the server.

This was working fine and stopped for some reason. The only changes I can remember making were formatting using ESLint.

How can I troubleshoot this further. The server is showing no error. The client error gives no useful info.

CLIENT

const socket = new WebSocket('ws://localhost:3000/echo');

socket.addEventListener('error', function(event) {
  console.log('DEBUG: WebSocket error:', event);
});

SERVER

function ws(app) {
  const expressWs = require('express-ws')(app);
  console.log('DEBUG: websocket server up');
  app.ws('/echo', (ws, req) => {
    ws.on('message', (msg) => {
      ws.send(msg);
    });
  }); 
}
module.exports = ws;

CLIENT ERROR:

WebSocket connection to 'ws://localhost:3000/echo' failed: 
about 4 years ago · Santiago Trujillo
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