Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

112
Vistas
Cannot connect to socketio server from client in nodejs
const { io } = require("socket.io-client");
const botSocket = io("http://localhost:1025");
botSocket.connect();

botSocket.on("connect_failed", function () {
  console.log("Sorry, there seems to be an issue with the connection!");
});

botSocket.onAny((data) => {
  console.log(data, "bot connect");
});

botSocket.on("connection", (data) => {
  console.log(data, "bot conenct");
});

Here is my code, but when I run it, nothing is logged ever, what am I doing wrong?

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos