Hi there,
My goal is to join multiple clients in WebGL to a self-hosted NGO Server - if possible with Unity Transport.
As WebGL does not support creating a Server on itself a dedicated Server is needed.
I tried this so far and am stuck:
- Auto-Start NGO Server if the command line argument “-launch-as-server” is given, tried both listening to 0.0.0.0 or 127.0.0.1
- Build the NGO Unity game with Linux Server Option (development = false)
- Run this build either directly in WSL or within a podman container with port 7777 exposed
Whatever I try I can not connect to the dedicated Server within Unity. However, when connecting two Unity instances (a server, a client) it works.
Has anyone already created a self-hosted NGO Server without Unitys Relay?
Do you know if another type of community transport may be needed?
I am a Beginner to Netcode for GameObjects (NGO). So I am thankful for any help!
Both client and dedicated server must have Websockets enabled for a web client to join that server. Is that the case?
This is somewhat unclear. You cannot connect TO the dedicated server from within Unity’s playmode? But two builds can connect? What are these builds (windows? web?) and where do they run: client locally and server remotely or also locally?
On first sight I’d say its most likely a network config issue (ie firewall, routing). Check if you may have to set up port forwarding on the server. This is especially important if that server isn’t directly connected to the Internet, or running in a virtual machine with its own IP address.
Can you successfully ping the remote server using its IP address?
Thank you CodeSmile for your quick response and the tip with the ping!
To clarify my setup:
- A NGO server (linux server built) is started within a podman container
- Within Unity Editor I try to connect as a client to that container server
I tried multiple things (connect client and server within the container, telnet, netstat) and in the end it worked 
Here is the solution that solved my issue:
- Unity Transport → Allow Remote Connection must be active
- Host must listen on 0.0.0.0 but client connect on 127.0.0.1
- I used WebSocket = active with Port 7778 but it probably would work as well with inactive and 7777