Cloudflare now supports Proxy Protocol v2 for TCP and UDP applications
Wed, December 11, 2019
We now support Proxy Protocol v2 for Spectrum customers. When a client connects to your service through Spectrum, your origin sees that connection coming in from one of the Cloudflare IPs – this is how reverse proxies work. But some of our customers would like to see the IP address of the original client.
In HTTP land, we passed that information along using the X-Forwarded-For header.For TCP or UDP applications, however, Cloudflare has used PROXY Protocol (for TCP applications) and Simple Proxy Protocol (for UDP applications) to pass that information along. Both these protocols have certain limitations:
- PROXY Protocol v1 is quite verbose and outdated, and not all software supports it.
- Simple Proxy Protocol is effective, but being a custom solution offered by Cloudflare, there is no out-of-the-box software that supports it.
PROXY Protocol v2 solves both of these problems by offering a binary format that is compatible with both UDP and TCP. Cloudflare will now support Proxy Protocol v2 for both TCP and UDP applications on our network.
For related API deprecations, see the API docs.