IGE Game Server and HTTP server in different machines

All things HTML5 or text based engines, or really any web based engines.
Post Reply
lucbr
Posts: 12
Joined: Mon Oct 14, 2013 11:27 pm

IGE Game Server and HTTP server in different machines

Post by lucbr »

Hi there dear friends!

I am facing some doubts about how to host an IGE game server and my regular HTTP server from different machines. I have read this article and it has not helped me exactly with what I want to do.

I going to explain what I want to do.

I want to have an IGE game server hosted in a machine at Amazon Web Services (AWS) from South America's datacenter.
Then, I want to have my regular HTTP server hosted in a different cloud service like Windows Azure. So, this regular HTTP server will serve all the necessary game assets to the realtime feature of my website. Then, when a client requests some realtime feature, it would connect to the IGE game server that is in the AWS datacenter in South America.

Question 1

Is it possible to be achieved? How hard could it be?

Question 2

After I read the article I mentioned before, It seemed to me that the IGE game server and the HTTP server must be on the same machine but using different ports. Is that the only way to go?

Thank you :)
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: IGE Game Server and HTTP server in different machines

Post by robaldred »

Its easy to achieve. Although you will have to have a copy of all the game code on both environments. All you need to do is change the client connection URL to point to the aws endpoint.
The client code you deploy to your azure platform and you deploy the same code with the server to your aws instance.
Run the game server on your aws instance, visit your client.

This is really very simple.
lucbr
Posts: 12
Joined: Mon Oct 14, 2013 11:27 pm

Re: IGE Game Server and HTTP server in different machines

Post by lucbr »

That's really nice to know. Thanks!

Look, Do you think that this kind of architecture can be a pain in the neck to maintain? I was wondering to achieve this because I want to use two different technologies like Asp.net for the regular website and Node.js with IGE for the realtime feature in my website.

Or the best way to go would be using Node.js for both the realtime server and http server? I believe I don't want to use Node.js for creating the entire website because finding Node.js developers is not so easy as finding an Asp.net or PHP developer....
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: IGE Game Server and HTTP server in different machines

Post by coolbloke1324 »

Hey.

In fact that is exactly what IGE is designed for.

When you have finished developing your game you "deploy" it using the engine's built-in deployment script. This will generate a client-only version of the game (all server-side code removed) and you can copy the resulting code to an HTTP server. The http server will serve the client-side game and the game will connect to whatever server you have told it to. The game servers need the non-deployed (e.g. the full source code) version of the game so that they contain the server-side game logic.

Keep in mind that there are cross-domain security issues to consider. You want to ensure that you are running your game servers from a single domain using sub-domains.

The easiest way to explain this is:

Your HTTP servers:

web1.mydomain.com
web2.mydomain.com

Your game servers:

game1.mydomain.com
game2.mydomain.com
game3.mydomain.com
game4.mydomain.com

In your index.html or at the top of your Client.js file ensure that you put a line:

Code: Select all

document.domain = 'mydomain.com';
This will ensure that the sub-domain-based HTTP served content is allowed to access other sub-domain-based content such as game1.mydomain.com from web2.mydomain.com without hitting a cross-domain security block. This is not an issue when using websockets but if you have fallback to other methods it is good to have this. I am actually going to build in a setting in the engine soon to do this automatically so no-one forgets when they are writing their games! :)
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
Post Reply

Return to “HTML5/Web Engines”