skillfed

proxy-protocol

PROXY protocol library with asyncio server implementation

proxy-protocol v0.11.3 1.9M downloads/30d#3,458 on PyPI17
Permissive license ## The MIT License (MIT) Copyright (c) 2021 Ian Good Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) DORMANT released

What it is and what it does

proxy-protocol is a Python library that implements the PROXY protocol specification, enabling asyncio servers to read and interpret connection headers sent by proxies and load balancers. When traffic passes through a reverse proxy or load balancer, the original client's IP address and port are typically lost; the PROXY protocol solves this by prepending a header to the connection that encodes the original source and destination. This library detects and parses both PROXY protocol v1 (text-based) and v2 (binary) formats, extracting the original connection information so your server can log or act on the true client address.

Integration is designed to be straightforward with asyncio servers. The package depends only on typing-extensions and supports Python 3.8, 3.9, 3.10, 3.11, and 3.12. It includes reference server implementations and supports configuration-driven protocol selection—detect automatically, enforce a specific version, or disable the protocol entirely.

Use it for:

  • Logging true client IPs in a web service behind a reverse proxy or load balancer.
  • Proxying connections between services while preserving original connection metadata.
  • Building a load balancer or proxy that needs to forward connection info to backend servers.
  • Debugging network topology by inspecting original vs. proxied connection information.
  • Integrating with HAProxy or other proxies that emit PROXY protocol headers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and handles the PROXY protocol (v1 and v2) for asyncio-based servers, allowing detection of original client connection information when traffic passes through proxies or load balancers.

Yes, if you need PROXY protocol support in an asyncio server and are comfortable with dormant maintenance. The library is stable (Alpha status), has no known vulnerabilities, and low install friction. However, verify that the last update (2024-04-27) and lack of recent activity align with your support expectations—if you need active maintenance or rapid bug fixes, evaluate alternatives or plan to maintain a fork.

Install

proxy-protocol on PyPI

pip

pip install proxy-protocol

uv

uv add proxy-protocol

poetry

poetry add proxy-protocol

Installing proxy-protocol

Before you install

Low install friction—pure Python wheel with only typing-extensions as a runtime dependency. Maintenance is dormant (last commit 2024-04-27, 839 days ago), though the repository remains active and the package is classified as Alpha.

License in practice

MIT license (permissive) permits use, modification, and redistribution with minimal restrictions, making it safe for commercial and private projects.

Quickstart

pip install proxy-protocol

from proxy_protocol import ProxyProtocol
import asyncio

pp_detect = ProxyProtocol()
server = await asyncio.start_server(callback, 'localhost', 10007)

Requires Python ~=3.8 or later; intended for use with asyncio.start_server-based applications.

Verify before relying

  • Whether dormant maintenance (last commit 2024-04-27) signals end-of-life or stable maturity for this use case.
  • Real-world performance characteristics with high-throughput proxy scenarios.
  • Compatibility with modern proxy/load-balancer implementations beyond the HAProxy specification.

Package facts

License ## The MIT License (MIT) Copyright (c) 2021 Ian Good Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive)
Python support supports the current Python release (~=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing-extensions
Maintenance dormant — 839 days since the last release
Last repo commit
First released
Downloads 1,893,391/month — #3,458 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: proxy_protocol-0.11.3-py3-none-any.whl

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

proxy protocol asynciohaproxy protocol parserdetect original client ipproxy protocol v1 v2asyncio server proxy headersload balancer connection infoproxy protocol implementation
asyncioproxy-protocolnetworking

More Internet packages