question

Daniel Gofman avatar image
Daniel Gofman asked

Running a websocket server on a GSDK multiplayer server

Hey,

So we have our gameserver running fine (which uses GSDK and everything) and for some external application I wanted to utilize a real time communication via websockets. I implemented a websocket server and everything is working great locally so when it was time to do some real testing I deployed the build to playfab. When uploading the assets I added the TCP port that I wanted to use for the websocket server to the configuration.

Now when I start a game I can see in the logs that the websocket server seems to start on the IP 0.0.0.0:port (which seems fine because I probably can't use localhost/127.0.0.1 within the container) but when I try to connect to it (using the IP of the VM that it is running on and the port I provided in the deploy config) I just get the error "ETIMEDOUT".

The websocket server runs without ssl (ws:// and not wss://), if it matters.

If I understand this article correctly: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/connecting-clients-to-game-servers

The IP I'm trying to access (of the VM) is the public-facing IP but somehow the TCP port I'm trying to use for the websocket server is not public faced. Our game client is able to connect fine through the public facing IP and the port 30000 tho. How do I know which public facing port I have to use to connect to the websocket server?

Please let me know if I forgot to specify any information

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Daniel Gofman avatar image
Daniel Gofman answered

Okay, I figured out that matchmade games contain the public facing ports in the GetMatch() call (e.g. 30000 is the first set port, then 30100 is the next one, etc.)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.