question

Christopher Kranebitter avatar image
Christopher Kranebitter asked

Hosting WebSocket game server

I am developing a WebGL game with Unity using DarkRift2 WebSocket servers hosted on PlayFab. A previous version using TCP and UDP instead of WebSocket was already up and running on PlayFab servers, but I had to switch to WebSocket after learning that WebGL does not support TCP and UDP.

I have successfully managed to get the DarkRift2 WebSocket server running locally with multiple clients connecting to it. I am now testing the containerized version of the server using the MockVmAgent, however, I am now unable to connect to the server.
I am unsure about what protocol I should specify in the MultiplayerSettings.json, so I am using TCP considering WebSocket is an extension of TCP.
Like I said before, the client is unable to connect to the server running in the MockVmAgents container.

MultiplayerSettings.json

"PortMappingsList": [
        [
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "game_port_tcp",
                    "Number": 4296,
                    "Protocol": "TCP"
                }
            }
        ]
    ],

DarkRiftServers Server.config

<listeners>
    <listener name="WebSocketListener" type="WebSocketNetworkListener" address="0.0.0.0" port="4296">
      <settings noDelay="true" />
    </listener>
  </listeners>


I could not find any information on the Internet on how to get a WebSocket server to run on PlayFab. Is WebSocket just not supported by PlayFab or am I missing something?

Best regards,
Chris

multiplayer
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

·
brendan avatar image
brendan answered

The PlayFab multiplayer hosting service is designed for hosting session-based games. It is technically possible to use those servers to run a web service, but the model would be different, since you'd need to find and join players to them more akin to the way you would for the session model (as opposed to just making API calls to it, relying on DNS).

So it's not really a great match, especially if you're using an off-the-shelf webservice as your base. You'll likely have fewer headaches if you just run these in Azure servers directly (likely as a Web App).

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.