0

I have been trying to get my WAMP Webserver run with socket.io but I just cannot seem to get it to work.

My socket server is on port 3000 and the WAMP on port 80. I know that both servers work.

Web Server Client Code:

<script src="/socket.io/socket.io.js"></script>
<script>
    var socket = io('http://[ip address]:3000');
    socket.on('buzz', function (data) {
    console.log(data);
});
</script>

Console Error:

Uncaught ReferenceError: io is not defined
at (index):97

UPDATE I was missing the socket.io.js file. But now I am getting

GET http://[[IP]]:3000/socket.io/?EIO=3&transport=polling&t=LxfQwpE
net::ERR_CONNECTION_TIMED_OUT

In the console every few seconds.

Samyok Nepal
  • 535
  • 3
  • 15

1 Answers1

0

As I recall, this problem was solved by installing a NGINX reverse proxy -- I believe I followed the instructions here: Socket.io with nginx

This was one of my first projects, but I thought I would point people in the right direction in case other students wish to use a WAMP backend and Socket.io.

Samyok Nepal
  • 535
  • 3
  • 15