Benoit Chesneau
f3190f84cc
feat: add PROXY protocol v2 support with version selection ( #3451 )
...
Extend --proxy-protocol to accept version values (off, v1, v2, auto) instead
of being boolean-only. This allows explicit control over which PROXY protocol
versions are accepted.
Changes:
- Add InvalidProxyHeader exception for v2 binary header errors
- Add validate_proxy_protocol() validator with backwards compatibility
- Update ProxyProtocol setting with nargs="?" and const="auto"
- Add PROXY v2 constants (PP_V2_SIGNATURE, PPCommand, PPFamily, PPProtocol)
- Add _parse_proxy_protocol_v1() and _parse_proxy_protocol_v2() methods
- Update both sync (message.py) and async (asgi/message.py) parsers
- Add hex escape handling in treq.py for v2 binary test data
- Add test cases for v2 TCPv4 and TCPv6
Backwards compatible: --proxy-protocol alone (or True) maps to "auto".
Closes #2912
2026-01-23 18:40:44 +01:00
..
2012-02-20 09:56:06 +01:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2010-06-03 16:11:18 -04:00
2012-10-24 22:07:35 +02:00
2012-05-24 12:13:34 +02:00
2016-09-17 12:49:05 +03:00
2024-08-06 23:47:01 +02:00
2024-08-06 23:47:01 +02:00
2024-08-06 23:47:01 +02:00
2024-08-06 23:47:01 +02:00
2016-09-17 12:49:05 +03:00
2016-09-17 12:49:05 +03:00
2017-08-25 10:50:34 +02:00
2017-08-25 10:50:34 +02:00
2019-11-18 19:44:01 -05:00
2019-11-18 19:44:01 -05:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2019-11-18 22:29:02 -05:00
2019-11-18 22:29:02 -05:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2023-12-15 13:33:31 +01:00
2013-12-30 00:14:46 +02:00
2013-12-30 00:14:46 +02:00
2017-12-28 11:32:47 +03:00
2017-12-28 11:32:47 +03:00
2024-08-07 19:42:16 +02:00
2024-08-07 19:42:16 +02:00
2024-08-07 19:42:16 +02:00
2024-08-07 19:42:16 +02:00
2024-08-07 19:42:16 +02:00
2024-08-07 19:42:16 +02:00
2012-09-27 19:14:40 +02:00
2012-10-24 22:07:35 +02:00
2012-09-27 19:14:40 +02:00
2012-10-24 22:07:35 +02:00
2026-01-23 18:40:44 +01:00
2026-01-23 18:40:44 +01:00
2026-01-23 18:40:44 +01:00
2026-01-23 18:40:44 +01:00
2026-01-23 18:40:44 +01:00
2026-01-23 18:40:44 +01:00