Skip to main content

Local dev reverse proxy to reproduce production prefix and forwarded-header behavior.

Project description

PrefxPy

CI PyPI version Python License: MIT

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-Host
  • X-Forwarded-Proto
  • X-Forwarded-Prefix
  • X-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefxpy-0.1.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefxpy-0.1.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for prefxpy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c3f1bbe576c0e01fd79a3ac99d4055494d0facc5faef146e79fddef9ee188cb7
MD5 7361b227bf36a4b2741184b3c791e924
BLAKE2b-256 c66129c57527fea43b7f1fe8db7a2d49f85564ee817cf9e4de4c8d928d81b859

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefxpy-0.1.3.tar.gz:

Publisher: publish.yml on smyrk2031/prefxpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for prefxpy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dfa953c5d7942a59c319ba61e81ebdd3b836c7d3e52efc62e3ffcef90a67ce79
MD5 a40344d9b09ba2d4ead98fbf8d6cdd04
BLAKE2b-256 033b5be5b8c211eded0d1a432c3ce0af5cf83bcb8f2541770dca7af0ea06f058

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefxpy-0.1.3-py3-none-any.whl:

Publisher: publish.yml on smyrk2031/prefxpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page