This document describes how to obtain real client IPs through Proxy Protocol V1/V2 when you enable the L4 proxy acceleration.


When the datagrams are accelerated through L4 acceleration connection, you can pass the real client IPs and Ports to the origin server through Proxy Protocol V1/V2. For introduction on the protocol, see Proxy Protocol V1/V2.

The origin can parse and obtain real client IPs with two methods based on the scenarios and deployment modes.
Method 1: If the TCP protocol is used on the origin, it is recommended to add a Nginx server that supports Proxy Protocol V1/V2 in front of the application server. For details, see Obtaining Real Client IPs Through Nginx.
Method 2: If the UDP protocol is used on the origin, or if you want to directly parse the real client IPs under the TCP protocol on the application server, you can parse the Proxy Protocol field on the application server by referring to the sample code in the Proxy Protocol. For details, see Parsing Real Client IPs on Application Server.