Foros del Web » Programando para Internet » Node.js »

socket.io net::ERR_CONNECTION_TIMED_OUT

Estas en el tema de socket.io net::ERR_CONNECTION_TIMED_OUT en el foro de Node.js en Foros del Web. Buenas tengo el siguiente, estoy haciendo pruebas con socket.io y unity. En localhost (mi pc) lo hice andar perfectamente pero ahora lo subí todo a ...
  #1 (permalink)  
Antiguo 08/02/2015, 16:09
 
Fecha de Ingreso: octubre-2010
Mensajes: 73
Antigüedad: 13 años, 5 meses
Puntos: 0
Pregunta socket.io net::ERR_CONNECTION_TIMED_OUT

Buenas tengo el siguiente, estoy haciendo pruebas con socket.io y unity.

En localhost (mi pc) lo hice andar perfectamente pero ahora lo subí todo a mi hosting para ver que tal funciona online y tengo el siguiente problema:

la ruta del app online: http://almightysystem.com.ar/UnityAp...ChatSocket.io/

Y me tira el siguiente loop de error:
Código:
GET http://almightysystem.com.ar:29011/socket.io/?EIO=3&transport=polling&t=1423454072758-3 net::ERR_CONNECTION_TIMED_OUT
el server.js:

Código:
var express = require('express');
var port = process.env.PORT || 29011;

var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.use(express.static(__dirname + '/public'));

io.on('connection', function(socket){
    socket.on('chat message', function(message){
        io.emit('chat message', message);
    });
});

http.listen(port, function(){
    console.log('Express server listening on port ' + port);
});

El script del cliente:

Código:
//SOCKET.IO
var socket = io.connect('http://almightysystem.com.ar:29011/');

socket.on('chat message', function(message){
    SendMessage ('ChatSystem', 'GetChatMessage', message);
    console.log("Mensaje recibido del Servidor hacia Unity: " + message);
});

function UnitySendMessage(message){
    socket.emit('chat message', message);
    console.log("Mensaje de Unity al Servidor: " + message);
}

Alguna idea que puede ser?
__________________
Página Principal: http://www.almightysystem.com.ar/

Última edición por Onsterion; 09/02/2015 a las 06:28
  #2 (permalink)  
Antiguo 10/02/2015, 09:42
 
Fecha de Ingreso: octubre-2010
Mensajes: 73
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

Arreglado y funcionando con
Código:
var socket = io('http://almightysystem.com.ar');
sin el puerto.

Pero ahora cuando inicia el cliente me sale este error (aunque funciona bien la aplicación).

Código:
    WebSocket connection to 'ws://almightysystem.com.ar/socket.io/?EIO=3&transport=websocket&sid=TLrXUY6GYoKSl-XVAAAC' failed: Error during WebSocket handshake: Unexpected response code: 400

Alguien sabe de socket.io?
__________________
Página Principal: http://www.almightysystem.com.ar/
  #3 (permalink)  
Antiguo 10/02/2015, 21:04
Avatar de utan  
Fecha de Ingreso: agosto-2012
Mensajes: 126
Antigüedad: 11 años, 8 meses
Puntos: 17
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

@Onsterion,

Hoy mismo tuve un error similar, estaba utilizando CloudFlare una vez lo elimine funciona bien...

Sin embargo como te estas conectando del cliente a el socket.io server desde el cliente usando el Puerto 80 , este te da ese error porque la respuesta que recibe no es la esperada..

Código Javascript:
Ver original
  1. var socket = io('http://tudominio.com:29011');
es la forma correcta de conectase a tu servidor.
__________________
Mis conocimientos son limitado, pero si te puedo ayudar lo are gustoso mi chat particular, visitalo gracias http://rendezvouschat.com
  #4 (permalink)  
Antiguo 11/02/2015, 06:59
 
Fecha de Ingreso: octubre-2010
Mensajes: 73
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

@utan

Es raro pero si lo pongo con el puerto:

Código:
var socket = io('http://almightysystem.com.ar:29011');
Deja de funcionar osea deja comunicarse y empieza a tirarme este error constantemente:

Código:
GET http://almightysystem.com.ar:29011/socket.io/?EIO=3&transport=polling&t=1423454072758-3 net::ERR_CONNECTION_TIMED_OUT
__________________
Página Principal: http://www.almightysystem.com.ar/
  #5 (permalink)  
Antiguo 11/02/2015, 09:19
Avatar de utan  
Fecha de Ingreso: agosto-2012
Mensajes: 126
Antigüedad: 11 años, 8 meses
Puntos: 17
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

Cita:
Iniciado por Onsterion Ver Mensaje
@utan

Es raro pero si lo pongo con el puerto:

Código:
var socket = io('http://almightysystem.com.ar:29011');
Deja de funcionar osea deja comunicarse y empieza a tirarme este error constantemente:

Código:
GET http://almightysystem.com.ar:29011/socket.io/?EIO=3&transport=polling&t=1423454072758-3 net::ERR_CONNECTION_TIMED_OUT

Revisa que tu puerto no este bloqueado por Firewall..
__________________
Mis conocimientos son limitado, pero si te puedo ayudar lo are gustoso mi chat particular, visitalo gracias http://rendezvouschat.com
  #6 (permalink)  
Antiguo 11/02/2015, 09:22
 
Fecha de Ingreso: octubre-2010
Mensajes: 73
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

Cita:
Iniciado por utan Ver Mensaje
Revisa que tu puerto no este bloqueado por Firewall..
29011 es el puerto default que da el hosting de webfaction cuando te crea el app de NODE.

Es raro que esté bloqueado.
__________________
Página Principal: http://www.almightysystem.com.ar/
  #7 (permalink)  
Antiguo 11/02/2015, 09:37
Avatar de utan  
Fecha de Ingreso: agosto-2012
Mensajes: 126
Antigüedad: 11 años, 8 meses
Puntos: 17
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

En ambos casos, revisar que el puerto en tu servidor no este bloqueado y que tu ISP no este bloqueandote el puerto tan bien..
__________________
Mis conocimientos son limitado, pero si te puedo ayudar lo are gustoso mi chat particular, visitalo gracias http://rendezvouschat.com
  #8 (permalink)  
Antiguo 11/02/2015, 09:38
Avatar de utan  
Fecha de Ingreso: agosto-2012
Mensajes: 126
Antigüedad: 11 años, 8 meses
Puntos: 17
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

Si mas recuerdo ayer estuve en tu app y me conecte bien..
__________________
Mis conocimientos son limitado, pero si te puedo ayudar lo are gustoso mi chat particular, visitalo gracias http://rendezvouschat.com
  #9 (permalink)  
Antiguo 11/02/2015, 10:27
 
Fecha de Ingreso: octubre-2010
Mensajes: 73
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

Recién vi en la consola que te conectaste, andar anda joya (solo que no agregue la lista de usuarios conectados todavía) pero responder responde a los usuarios que se conecten, lo que no entiendo es por que la primera vez que inicia
Código:
 socket = io('http://almightysystem.com.ar');
me tira el error:

Código:
WebSocket connection to 'ws://almightysystem.com.ar/socket.io/?EIO=3&transport=websocket&sid=Xu03h7r8HeQ_Y9wLAAAI' failed: Error during WebSocket handshake: Unexpected response code: 400
Y sigue funcionando todo sin problemas pero cuando le agrego el puerto ahí ya no funciona.
__________________
Página Principal: http://www.almightysystem.com.ar/
  #10 (permalink)  
Antiguo 11/02/2015, 13:56
Avatar de utan  
Fecha de Ingreso: agosto-2012
Mensajes: 126
Antigüedad: 11 años, 8 meses
Puntos: 17
Respuesta: socket.io net::ERR_CONNECTION_TIMED_OUT

ok,

Volví a entrar y mi consola me da un error
Código Javascript:
Ver original
  1. Firefox can't establish a connection to the server at ws://almightysystem.com.ar/socket.io/?EIO=3&transport=websocket&sid=69HSMy3wPNXvhpLLAAAN.

Muy parecido a mi problema con Cloudflare.. que solo me dejaba usar Protocolo Polling cuando me daba ese error.
__________________
Mis conocimientos son limitado, pero si te puedo ayudar lo are gustoso mi chat particular, visitalo gracias http://rendezvouschat.com

Etiquetas: express
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:47.