Home > Back-end >  Sending data between local game server and remote hosted server
Sending data between local game server and remote hosted server

Time:05-19

Lets say I have a web server that is hosted within a vServer of a hosting company and a game server that I have running locally at home.

I now want to run a webpage on the web server that can bi-directionally share information with the game server, e.g. sending in-game commands from an Admin panel and collecting responses. So something like:

[local game server] <--- PROTOCOL ---> [web server]

Which protocol/technology would I use here/would be recommended?

CodePudding user response:

If you are looking for a solution other than RCON, there are a few standard solutions.

One would be to use HTTP, where either the web server (probably the easiest) or the game server acts as a listener. If the web server is the listener, the game server can "poll" the server with HTTP requests to get updates. See: long polling

Another solution is to use sockets which can open a bidirectional stream between the servers. This option might take a bit longer to implement (you'd want to implement reconnection), but would be the better solution for high frequency data transfer between the two servers.

Based on your example use case, I would lean towards the first as it would probably be simpler to implement.

  • Related