This topic describes how to use SDKs to integrate HTTP and HTTPS applications into GameShield. These HTTP and HTTPS applications include APIs, and websites for user logon and data retrieval.

Configure a protection target in the GameShield console

When you add a protection target to GameShield by using the console, you must specify a standard domain name as the protection target ID. The new domain name must point to the IP address 127.0.0.1. The following figure shows how to configure a protection target.

Protection target

For more information about how to add a protection target, see Step 2: Create a Business.

Call an SDK by using a game client

GameShield concatenates and converts the IP address 127.0.0.1 and port 8901 (a random port number) from a protection target ID to an HTTP address. For example, http://127.0.0.1:8910.

For HTTPS applications, you must replace 127.0.0.1 with a standard domain name that has an SSL certificate configured. The domain name must point to 127.0.0.1. An example of the domain name is http://login-for-yxd.vivre.cn:8910/login-for-yxd.vivre.cn. This method helps you fix issues in hostname matching and certificate verification.

Sample code

String url = 'https://'+"login-for-yxd.vivre.cn"+':'+target_port.toString();//The URL of an HTTPS short-lived connection request. 

The target_port.toString() method returns a local random port number.

References

For more information, see Best practice for dealing with HTTPS business. This topic provides instructions about how to integrate an HTTPS application into GameShield.