+1 vote

Scenario: I had the idea of creating a simple quiz game for me and my housemates, which would be hosted as an HTML5 export on my remote server. This server is just an old PC of mine and thus I thought of making one of the players, that downloaded the game over their browser, the game server itself, so that this player has one server instance running and in parallel the normal game client to play. In the next step there would be some sort of network discovery to find this running instance at the other clients.

Goal: Decentralised hosts for LAN multiplayer in HTML5 exports.

Question: Can I run a server over one of the implemented network protocols of the engine or is there some restriction of the browser to disallow creating servers for security reasons?

Additional: WebsocketServers are noted to not work within HTML5, but why is this?

Thanks for your help,


Godot version v3.2.3.stable
in Engine by (16 points)

1 Answer

+1 vote
Best answer

Due to browser security restrictions (on top of port forwarding issues that would stem from player-hosted servers), there is no way to run a WebSocketServer from HTML5. You have to use a dedicated server to host the WebSocketServer.

by (12,893 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.