Local dev reverse proxy to reproduce production prefix and forwarded-header behavior.
Project description
PrefxPy
A small local reverse proxy for reproducing production subpath / reverse-proxy issues during development.
Works well when your app behaves differently behind a path prefix (e.g. /myapp/) or with X-Forwarded-* headers — problems that often only show up in staging or production.
Not a high-performance production proxy. Use it for local verification with FastAPI, Django, Flask, and similar stacks.
Install
pip install prefxpy
Quick start
prefxpy
Defaults:
- Public URL:
http://127.0.0.1:9000/myapp/ - Upstream:
http://127.0.0.1:8000
Another upstream port:
prefxpy --target http://127.0.0.1:5000
On startup, PrefxPy prints the URL to open in your browser.
Config file
prefxpy --config prefxpy.toml
See examples/prefxpy.example.toml for a sample. CLI flags override file values when set.
By default PrefxPy sets these forwarded headers on upstream requests:
X-Forwarded-HostX-Forwarded-ProtoX-Forwarded-PrefixX-Forwarded-For
Development
git clone https://github.com/smyrk2031/prefxpy.git
cd prefxpy
pip install -e ".[dev]"
pytest
Publishing to TestPyPI / PyPI: docs/PYPI.md.
Documentation
| Language | Topic |
|---|---|
| 日本語 | 仕様 · 設計 |
| English | This README · Project site |
License
PrefxPy is released under the MIT License.
Third-party licenses for runtime dependencies (aiohttp, httpx, etc.) are listed in THIRD_PARTY_NOTICES.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prefxpy-0.1.3.tar.gz.
File metadata
- Download URL: prefxpy-0.1.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3f1bbe576c0e01fd79a3ac99d4055494d0facc5faef146e79fddef9ee188cb7
|
|
| MD5 |
7361b227bf36a4b2741184b3c791e924
|
|
| BLAKE2b-256 |
c66129c57527fea43b7f1fe8db7a2d49f85564ee817cf9e4de4c8d928d81b859
|
Provenance
The following attestation bundles were made for prefxpy-0.1.3.tar.gz:
Publisher:
publish.yml on smyrk2031/prefxpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prefxpy-0.1.3.tar.gz -
Subject digest:
c3f1bbe576c0e01fd79a3ac99d4055494d0facc5faef146e79fddef9ee188cb7 - Sigstore transparency entry: 2085450913
- Sigstore integration time:
-
Permalink:
smyrk2031/prefxpy@1639f3e46742e9d4271478cfe0a668807b98458a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/smyrk2031
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1639f3e46742e9d4271478cfe0a668807b98458a -
Trigger Event:
push
-
Statement type:
File details
Details for the file prefxpy-0.1.3-py3-none-any.whl.
File metadata
- Download URL: prefxpy-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfa953c5d7942a59c319ba61e81ebdd3b836c7d3e52efc62e3ffcef90a67ce79
|
|
| MD5 |
a40344d9b09ba2d4ead98fbf8d6cdd04
|
|
| BLAKE2b-256 |
033b5be5b8c211eded0d1a432c3ce0af5cf83bcb8f2541770dca7af0ea06f058
|
Provenance
The following attestation bundles were made for prefxpy-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on smyrk2031/prefxpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prefxpy-0.1.3-py3-none-any.whl -
Subject digest:
dfa953c5d7942a59c319ba61e81ebdd3b836c7d3e52efc62e3ffcef90a67ce79 - Sigstore transparency entry: 2085451007
- Sigstore integration time:
-
Permalink:
smyrk2031/prefxpy@1639f3e46742e9d4271478cfe0a668807b98458a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/smyrk2031
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1639f3e46742e9d4271478cfe0a668807b98458a -
Trigger Event:
push
-
Statement type: