Can HTML5 Godot Demo "Websocket_chat" be deployed on IIS or Apache and run as chat server?

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

Bottom line question is: Is it possible at all to run websocket based godot server from standard webservers like IIS, Apache, …? How exactly.

The referenced project “websocket_chat” is part of “Godot 3.1 Demo Projects” under category “networking”. When exported in HTML5 (GLES3) and deployed to IIS it seems the WebSocketServer part is having difficulties establishing listening port (8000): Error listening on port 8000.

If exported to Windows executable the chat Server works (is listening). Interesting is that we can disable support for WebSocket on IIS and chat Clients in web browser have no problem connecting to standalone server (Windows build) that uses websockets.

:bust_in_silhouette: Reply From: klaas

Hi,
Is it possible at all to run websocket based godot server from standard webservers like IIS, Apache
IIS seems to integrate this … comes up as first google search result

Apache usualy not

When exported in HTML5 (GLES3) and deployed to IIS it seems the WebSocketServer part is having difficulties establishing listening port (8000): Error listening on port 8000.

You need a websocket server running on the port or else you cant connect. The browser cant establish a socket, it only can connect to one.

If exported to Windows executable the chat Server works (is listening). Interesting is that we can disable support for WebSocket on IIS and chat Clients in web browser have no problem connecting to standalone server (Windows build) that uses websockets.

The IIS doesnt hinder the browser from connecting to the executables socket.

I think your understanding of WebSockets workings isnt to good. Maybe you want to google for some tutorials that clearifies the subject.

You need a websocket server running on the port or else you cant connect. The browser cant establish a socket, it only can connect to one.

This answer needs more details / arguments. The question is about how to start listening port hosted on IIS from web application (made with Godot) - from browser to put it in plain words. If it is not possible then everyone should know why this is not possible. This should be documented in Websocket section of Godot Documentation.

Strip | 2020-09-23 10:29

The question was "Can HTML5 Godot Demo “Websocket_chat” be deployed on IIS or Apache and run as chat server?!

Wich it cant because web applications cant start a server. It only can connect to a server. The Server has to be implemented on server side.

I think i would be better to first point to the missunderstanding of who is a server who is a client. Wich i see is a bit mixed up.

klaas | 2020-09-23 10:47

:bust_in_silhouette: Reply From: Strip

Let me answer this properly: It is not possible to run websocket based godot server from standard webservers like IIS, Apache. Godot has no possibilities to integrate with IIS or any other webserver for that matter. HTML5 is client-side technology that runs in web browser even though it is deployed on web servers like IIS, Apache.

It is possible to integrate websocket application server with IIS using ASP.NET Core:
Overview of ASP.NET Core | Microsoft Learn