socket.io-client icon indicating copy to clipboard operation
socket.io-client copied to clipboard

Problem with the port number

Open dall opened this issue 15 years ago • 1 comments

Hello,

I'm testing socket.io 0.7 and I found a problem with the port number. I would like to provide the page with nginx and use nodejs only for socket.io. This is my setup:

NGINX: port 85
NODE: port 9000

This is my simple client-side script:

<script src="http://damiano.local:9000/socket.io/socket.io.js"></script>

<script>
  var socket = io.connect("http://damiano.local:9000");

  socket.on('connect', function () {

    socket.send("Text from client");

    socket.on('custom', function (msg) {      
      console.log("Received: " + msg.text);
    });

  });
</script>

obviously I have set "damiano.local" to 127.0.0.1 in my /etc/hosts As you see I always used 9000 port on the src and on the .connect() function, but if i have this setup I get a 404 error:

GET http://damiano.local:85/socket.io/1/?t=1308485264979&jsonp=0 404 (Not Found)

The path is wrong, it should be:

GET http://damiano.local:9000/socket.io/1/?t=1308485264979&jsonp=0

It use the port that nginx is using, but I have set 9000 for it.

Thanks

dall avatar Jun 19 '11 12:06 dall

I'll take a look at it, thanks for reporting

3rd-Eden avatar Jun 19 '11 16:06 3rd-Eden