Registry / http-networking / fastapi-proxy-lib

fastapi-proxy-lib

JSON →
library0.3.0pypypiunverified

HTTP/WebSocket proxy middleware for Starlette/FastAPI, version 0.3.0, allowing you to add a reverse proxy endpoint with minimal code. Released as needed.

pip install fastapi-proxy-lib
INSTALL
IMPORT
SIG · FASTAPI-PROXY-LIB
F
fastapi-proxy-lib
http-networkingpythonv0.3.0
Install
2.4s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 24MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

add_route_proxy
from fastapi_proxy_lib import add_route_proxy
from fastapi_proxy_lib import add_route_proxy

Creates a FastAPI app with a catch-all proxy endpoint that forwards requests to httpbin.

from fastapi import FastAPI from fastapi_proxy_lib import reverse_proxy app = FastAPI() @app.get('/proxy/{path:path}') async def proxy(path: str): target = f'https://httpbin.org/{path}' return await reverse_proxy(target) # run with: uvicorn main:app --reload
Debug
Known issues
breakingIn 0.3.0, the signature of `reverse_proxy` changed; the first argument is now a URL string instead of a request object. Old code will raise TypeError.
fix
Update to `await reverse_proxy('https://target.com/path')` instead of `await reverse_proxy(request, url='https://target.com/path')`.
affects: >=0.3.0
gotchaThe `reverse_proxy` function expects an absolute URL. Relative paths will cause an httpx.InvalidURL exception.
fix
Always provide a fully qualified URL (including scheme and host) to `reverse_proxy`.
affects: all
deprecatedThe `add_route_proxy` function was deprecated in 0.3.0 in favor of `reverse_proxy`. It will be removed in a future version.
fix
Replace `add_route_proxy(app, ...)` with a custom route that calls `reverse_proxy`.
affects: 0.3.0
Upgrade
Version history
0.3.0latest on PyPI · released Mar 25, 2025
Audit
Dependencies
starletterequiredrequired for the base ASGI framework
httpxrequiredused to forward client requests
Agent activity
24 hits · last 30 days
node
24
Resources
fastapi-proxy-lib — pip install fastapi-proxy-lib · libregistry