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

171
Vistas
Can't connect to WebSocket using Socket.io | WS

I'm trying to connect to wss://csgoexo.com/socket.io/ using socket.io-client@2.4.0. I really don't understand what I'm doing wrong. Could you help me, I can pay for it, I'm seriously tired of this. I also used "ws" library - all the same. Code:

const Io = require("socket.io-client"); //2.4.0

async function wsConnect(){
  const socket = Io('wss://csgoexo.com/socket.io/', {
    transports: ["websocket"],
    extraHeaders: {
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",
      "Origin": "https://csgoexo.com"
    }
  });

  socket.on('connect', () => {
    console.log('Connected!', {id: socket.id});
  });
  // socket.on('close', (reason) => {
  //   console.log(reason)
  // })
  socket.on("disconnect", (reason) => {
    console.log('Disconnected', reason)
    if (reason === "io server disconnect") {
      // the disconnection was initiated by the server, you need to reconnect manually
      socket.connect();
    }
    // else the socket will automatically try to reconnect
  });
  socket.on("connect_error", (error) => {
    console.log(error)
  });
}

wsConnect();

https://www.piesocket.com/ - it works with this service. Error: 403. 'Unexpected server response: 403', CloseCode: 1006

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