Can I start a server on an web export?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gamemap

I run my Web exported program on a localhost server (python) and want to start a Godot server but I can’t connect to this. Localhost and the port of the python server dosen’t work either.

:bust_in_silhouette: Reply From: tx350z

I asked a similar question a couple months ago and didn’t get a clear answer. Based on my experimenting, the answer is “yes, but don’t”. Failure to connect to a local host server can be caused by a number of things. First, the Godot server must use a different port than that used by the web server (usually port 80). Second, the HTML exported “server app” cannot run unless the web page hosting it is loaded. Try loading the server page in one browser, then load the client page in a second browser. Based on my experiments, the HTML export is not a viable option for Godot server apps.

If you are planning to making your game publicly available, you need to be aware of the limitations of HTML exports of a server apps. If you plan to host your server on an inexpensive shared hosting service, it won’t work without a dedicated IP. Shared hosting plans often map domain names to different ports on a common host server IP. Obviously, trying to open a server listener on a port not mapped to your domain is going to fail. You will need either a VPS with static IP or a dedicated physical host with a static IP.

I also can’t connect a web client to an .exe server. In the Web debugger (Firefox) is this Warning.

Do you know what this mean?

Gamemap | 2021-04-22 13:50

I realized that I need to use Websocket and not the MultiplayerENet function.

Thanks for your answer.

Gamemap | 2021-04-22 14:01

If you’re asking whether you can start a server on a web hosting platform (often referred to as “web export” in some contexts), the answer is yes, but it depends on the type of hosting service you choose and the permissions provided by the hosting provider.

  1. shared hosting
  2. dedicated hosting
  3. Cloud hosting
  4. VPS hosting

Things to Consider:

  • Permissions and Capabilities: Check with the hosting provider about the permissions and capabilities you have, especially if you need to install specific server software.
    Technical Skills: Running a server requires technical knowledge, especially for VPS and dedicated hosting. Ensure you have the skills needed or access to technical support.
    Resource Requirements: Understand the resource requirements of your server application to choose the appropriate hosting plan.
    Security and Maintenance: Running a server comes with responsibilities like ensuring security and regular maintenance.
    Cost: More control and resources typically mean higher costs. Balance your needs with your budget.

I hope this helps.

Thank you