Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiplayer.html stops at "connecting to server..." #18

Closed
Bayside308 opened this issue Nov 8, 2017 · 4 comments
Closed

multiplayer.html stops at "connecting to server..." #18

Bayside308 opened this issue Nov 8, 2017 · 4 comments

Comments

@Bayside308
Copy link

Hello!

I'm using a Windows 10 computer to test this out locally. I'm using the npm http-server as my web server, which is functioning properly. I'm opening the page through localhost:8081/multiplayer.html, and it allows me to enter a name. After that, however, it just freezes at "connecting to server...".

I'm able to start the server.js file with no issues.

The web server outputs this error:
"POST /socket.io/?EIO=3&transport=polling&t=L-PW7s9" Error (404): "Not found"
Chrome outputs this error:
POST http://localhost:8081/socket.io/?EIO=3&transport=polling&t=L-PVxHX 405 (Method Not Allowed)

@Overv
Copy link
Owner

Overv commented Nov 8, 2017

Perhaps raise this issue with socket.io.

@Bayside308
Copy link
Author

Will do! Is there anything else I should be doing that I missed? I am supposed to run a web server, as the server.js doesn't do that, right?

@Overv
Copy link
Owner

Overv commented Nov 10, 2017

Ah, the problem is that it expects the WebSocket server to be on the same origin (localhost:8081) whereas I think the server.js hosts it on port 80. The HTML and WebSocket stuff should be served on the same port or you need to change the connecting code in multiplayer.html.

I'm not sure how I ran the server when I worked on this project, but I may have used a reverse proxy to forward just the /socket.io/ stuff to server.js.

@Overv
Copy link
Owner

Overv commented Jan 4, 2018

I just tested it on my own PC. I started the server with node server.js and browsed to http://localhost:3000/multiplayer.html. That works fine here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants