This topic describes how to obtain real IP addresses of clients that access a game running on a Linux server.

Integrate a TOA module by using application hooks

  1. Run the script to install services that relate to the toa_server.
  2. Specify when starting an application service. If the name of an application service is nginx, you can use the following command to start the application server.
    LD_PRELOAD=./ ./nginx
    Note You must find the entry point of your program and include the parameter in the preceding command to start the service.
    nginx service
    1. Run the script.
    2. Check whether the /usr/lib/systemd/system/nginx.service file exists.
    3. Use the following command to update the script.
      cat > /root/
    4. Add the following statements to the file and replace with the full path of the file.
      #! /bin/bash /usr/sbin/nginx
    5. Use the following command to modify the permissions for the file.
      chmod +x /root/
    6. Use the following command to edit the nginx.service file.
      vi /usr/lib/systemd/system/nginx.service
    7. Replace ExecStart=/usr/sbin/nginx with ExecStart=/root/
    8. Use the following command to restart the nginx service.
      service nginx restart
    9. Use the following command to enable automatic start for the nginx service at startup.
      systemctl enable nginx.service
      Note You can also start the nginx service by adding the following statements to the script.
      killall nginx /usr/local/nginx/sbin/nginx

      Then, you must add the directory where the file resides to the rc.local startup configuration file.

  3. Check whether is loaded by the nginx service.
    The followin example command are provided for your reference.
    • To check whether a port is enabled: netstat -ntulp |grep 48888
    • To check whether the nginx service is running and view its PID: ps -ef | grep nginx
    • To check whether is loaded: cat /proc/PID/maps | grep

Integrate a TOA module by modifying application code

The TOA module of GameShield installs a process on an origin server. The process listens on UDP port 48888. A game process passes non-real port numbers and IP addresses to port 48888 by using a specific format and retrieves port numbers and real IP addresses from the process.

  • You must make sure that UDP port 48888 is not disabled by the firewall on the localhost of
  • When you configure settings to allow access to the endpoint of through UDP, you must specify a timeout period. This setting helps avoid denial of services due to unexpected issues.
  • You can retrieve real IP addresses by using the bypass method. In theory, retrieving real IP addresses seldom fails. However, you still need to prepare related solutions when an application process fails to retrieve real IP addresses.
  • In a server-client connection, data that relates to IP addresses and ports is deleted when one of the parties closes the connection socket. You must re-establish a connection between the server and the client to create data that relates to IP addresses and ports.

For more information, see the instructions that are provided in the TOA archive. You can also contact GameShield Technical Support.