prefxpy 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+ *.egg
12
+ pip-wheel-metadata/
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+ ENV/
18
+
19
+ # Test / lint caches
20
+ .pytest_cache/
21
+ .ruff_cache/
22
+ .mypy_cache/
23
+ .coverage
24
+ htmlcov/
25
+
26
+ # Editors
27
+ .idea/
28
+ .vscode/
29
+ *.swp
30
+ *~
31
+
32
+ # OS
33
+ .DS_Store
34
+ Thumbs.db
35
+
36
+ # Local dev notes (not for the public repo)
37
+ PathGuardの仕様書.md
38
+ アプリ名:PrefxPy にする
prefxpy-0.1.3/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kushi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
prefxpy-0.1.3/PKG-INFO ADDED
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: prefxpy
3
+ Version: 0.1.3
4
+ Summary: Local dev reverse proxy to reproduce production prefix and forwarded-header behavior.
5
+ Project-URL: Homepage, https://github.com/smyrk2031/prefxpy
6
+ Project-URL: Documentation, https://smyrk2031.github.io/prefxpy/
7
+ Project-URL: Repository, https://github.com/smyrk2031/prefxpy
8
+ Project-URL: Issues, https://github.com/smyrk2031/prefxpy/issues
9
+ Author: kushi
10
+ License: MIT
11
+ License-File: LICENSE
12
+ License-File: THIRD_PARTY_NOTICES.md
13
+ Keywords: django,fastapi,flask,proxy,reverse-proxy,subpath
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: aiohttp>=3.10.0
16
+ Requires-Dist: httpx>=0.27.0
17
+ Requires-Dist: tomli>=2.0.1; python_version < '3.11'
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
20
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
21
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # PrefxPy
25
+
26
+ [![CI](https://github.com/smyrk2031/prefxpy/actions/workflows/ci.yml/badge.svg)](https://github.com/smyrk2031/prefxpy/actions/workflows/ci.yml)
27
+ [![PyPI version](https://img.shields.io/pypi/v/prefxpy)](https://pypi.org/project/prefxpy/)
28
+ [![Python](https://img.shields.io/pypi/pyversions/prefxpy)](https://pypi.org/project/prefxpy/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
30
+
31
+ A small local reverse proxy for reproducing **production subpath / reverse-proxy issues** during development.
32
+
33
+ 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.
34
+
35
+ **Not** a high-performance production proxy. Use it for local verification with FastAPI, Django, Flask, and similar stacks.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install prefxpy
41
+ ```
42
+
43
+ ## Quick start
44
+
45
+ ```bash
46
+ prefxpy
47
+ ```
48
+
49
+ Defaults:
50
+
51
+ - Public URL: `http://127.0.0.1:9000/myapp/`
52
+ - Upstream: `http://127.0.0.1:8000`
53
+
54
+ Another upstream port:
55
+
56
+ ```bash
57
+ prefxpy --target http://127.0.0.1:5000
58
+ ```
59
+
60
+ On startup, PrefxPy prints the **URL to open** in your browser.
61
+
62
+ ## Config file
63
+
64
+ ```bash
65
+ prefxpy --config prefxpy.toml
66
+ ```
67
+
68
+ See [`examples/prefxpy.example.toml`](examples/prefxpy.example.toml) for a sample. CLI flags override file values when set.
69
+
70
+ By default PrefxPy sets these forwarded headers on upstream requests:
71
+
72
+ - `X-Forwarded-Host`
73
+ - `X-Forwarded-Proto`
74
+ - `X-Forwarded-Prefix`
75
+ - `X-Forwarded-For`
76
+
77
+ ## Development
78
+
79
+ ```bash
80
+ git clone https://github.com/smyrk2031/prefxpy.git
81
+ cd prefxpy
82
+ pip install -e ".[dev]"
83
+ pytest
84
+ ```
85
+
86
+ Publishing to TestPyPI / PyPI: [`docs/PYPI.md`](docs/PYPI.md).
87
+
88
+ ## Documentation
89
+
90
+ | Language | Topic |
91
+ |----------|-------|
92
+ | 日本語 | [仕様](docs/仕様.md) · [設計](docs/設計.md) |
93
+ | English | This README · [Project site](https://smyrk2031.github.io/prefxpy/) |
94
+
95
+ ## License
96
+
97
+ PrefxPy is released under the [MIT License](LICENSE).
98
+
99
+ Third-party licenses for runtime dependencies (aiohttp, httpx, etc.) are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,76 @@
1
+ # PrefxPy
2
+
3
+ [![CI](https://github.com/smyrk2031/prefxpy/actions/workflows/ci.yml/badge.svg)](https://github.com/smyrk2031/prefxpy/actions/workflows/ci.yml)
4
+ [![PyPI version](https://img.shields.io/pypi/v/prefxpy)](https://pypi.org/project/prefxpy/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/prefxpy)](https://pypi.org/project/prefxpy/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ A small local reverse proxy for reproducing **production subpath / reverse-proxy issues** during development.
9
+
10
+ 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.
11
+
12
+ **Not** a high-performance production proxy. Use it for local verification with FastAPI, Django, Flask, and similar stacks.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ pip install prefxpy
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ prefxpy
24
+ ```
25
+
26
+ Defaults:
27
+
28
+ - Public URL: `http://127.0.0.1:9000/myapp/`
29
+ - Upstream: `http://127.0.0.1:8000`
30
+
31
+ Another upstream port:
32
+
33
+ ```bash
34
+ prefxpy --target http://127.0.0.1:5000
35
+ ```
36
+
37
+ On startup, PrefxPy prints the **URL to open** in your browser.
38
+
39
+ ## Config file
40
+
41
+ ```bash
42
+ prefxpy --config prefxpy.toml
43
+ ```
44
+
45
+ See [`examples/prefxpy.example.toml`](examples/prefxpy.example.toml) for a sample. CLI flags override file values when set.
46
+
47
+ By default PrefxPy sets these forwarded headers on upstream requests:
48
+
49
+ - `X-Forwarded-Host`
50
+ - `X-Forwarded-Proto`
51
+ - `X-Forwarded-Prefix`
52
+ - `X-Forwarded-For`
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ git clone https://github.com/smyrk2031/prefxpy.git
58
+ cd prefxpy
59
+ pip install -e ".[dev]"
60
+ pytest
61
+ ```
62
+
63
+ Publishing to TestPyPI / PyPI: [`docs/PYPI.md`](docs/PYPI.md).
64
+
65
+ ## Documentation
66
+
67
+ | Language | Topic |
68
+ |----------|-------|
69
+ | 日本語 | [仕様](docs/仕様.md) · [設計](docs/設計.md) |
70
+ | English | This README · [Project site](https://smyrk2031.github.io/prefxpy/) |
71
+
72
+ ## License
73
+
74
+ PrefxPy is released under the [MIT License](LICENSE).
75
+
76
+ Third-party licenses for runtime dependencies (aiohttp, httpx, etc.) are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,78 @@
1
+ # Third-Party Notices
2
+
3
+ PrefxPy (prefxpy) is licensed under the MIT License. See [LICENSE](LICENSE).
4
+
5
+ This product bundles or depends on the following third-party software.
6
+ When you install `prefxpy` from PyPI, `pip` may also install transitive
7
+ dependencies required by the packages below.
8
+
9
+ ## Runtime dependencies (installed with `pip install prefxpy`)
10
+
11
+ | Package | License | Project |
12
+ |---------|---------|---------|
13
+ | aiohttp | Apache License 2.0 | https://github.com/aio-libs/aiohttp |
14
+ | httpx | BSD 3-Clause License | https://github.com/encode/httpx |
15
+ | tomli (Python 3.10 only) | MIT License | https://github.com/hukkin/tomli |
16
+
17
+ Python 3.11 and later use the standard library module `tomllib` instead of
18
+ `tomli`.
19
+
20
+ ### Apache License 2.0 (aiohttp)
21
+
22
+ Licensed under the Apache License, Version 2.0 (the "License");
23
+ you may not use this file except in compliance with the License.
24
+ You may obtain a copy of the License at:
25
+
26
+ http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ Unless required by applicable law or agreed to in writing, software
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ See the License for the specific language governing permissions and
32
+ limitations under the License.
33
+
34
+ ### BSD 3-Clause License (httpx)
35
+
36
+ Redistribution and use in source and binary forms, with or without
37
+ modification, are permitted provided that the following conditions are met:
38
+
39
+ 1. Redistributions of source code must retain the above copyright notice,
40
+ this list of conditions and the following disclaimer.
41
+ 2. Redistributions in binary form must reproduce the above copyright notice,
42
+ this list of conditions and the following disclaimer in the documentation
43
+ and/or other materials provided with the distribution.
44
+ 3. Neither the name of the copyright holder nor the names of its
45
+ contributors may be used to endorse or promote products derived from
46
+ this software without specific prior written permission.
47
+
48
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
52
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
53
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
54
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
55
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
56
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
57
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
58
+ POSSIBILITY OF SUCH DAMAGE.
59
+
60
+ ## Development dependencies (optional, `pip install prefxpy[dev]`)
61
+
62
+ These packages are used for tests and linting only. They are **not** required
63
+ to run the `prefxpy` command in production or local use.
64
+
65
+ | Package | License | Project |
66
+ |---------|---------|---------|
67
+ | pytest | MIT License | https://github.com/pytest-dev/pytest |
68
+ | pytest-asyncio | Apache License 2.0 | https://github.com/pytest-dev/pytest-asyncio |
69
+ | ruff | MIT License | https://github.com/astral-sh/ruff |
70
+
71
+ ## Notes
72
+
73
+ - License texts above are summaries for convenience. The authoritative license
74
+ for each dependency is included in that package's installation metadata and
75
+ source repository.
76
+ - If your organization requires a full compliance review, obtain the complete
77
+ license files from each installed package (for example under
78
+ `site-packages/` after installation).
@@ -0,0 +1,56 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.25.0"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "prefxpy"
7
+ version = "0.1.3"
8
+ description = "Local dev reverse proxy to reproduce production prefix and forwarded-header behavior."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ license-files = ["LICENSE", "THIRD_PARTY_NOTICES.md"]
13
+ authors = [{ name = "kushi" }]
14
+ keywords = ["proxy", "reverse-proxy", "subpath", "fastapi", "django", "flask"]
15
+ dependencies = [
16
+ "aiohttp>=3.10.0",
17
+ "httpx>=0.27.0",
18
+ "tomli>=2.0.1; python_version < '3.11'",
19
+ ]
20
+
21
+ [project.optional-dependencies]
22
+ dev = [
23
+ "pytest>=8.3.0",
24
+ "pytest-asyncio>=0.24.0",
25
+ "ruff>=0.8.0",
26
+ ]
27
+
28
+ [project.scripts]
29
+ prefxpy = "prefxpy.cli:main"
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/smyrk2031/prefxpy"
33
+ Documentation = "https://smyrk2031.github.io/prefxpy/"
34
+ Repository = "https://github.com/smyrk2031/prefxpy"
35
+ Issues = "https://github.com/smyrk2031/prefxpy/issues"
36
+
37
+ [tool.pytest.ini_options]
38
+ asyncio_mode = "auto"
39
+ testpaths = ["tests"]
40
+
41
+ [tool.ruff]
42
+ line-length = 100
43
+ target-version = "py310"
44
+
45
+ [tool.ruff.lint]
46
+ select = ["E", "F", "I"]
47
+
48
+ [tool.hatch.build.targets.sdist]
49
+ include = [
50
+ "/LICENSE",
51
+ "/THIRD_PARTY_NOTICES.md",
52
+ ]
53
+
54
+ [tool.hatch.build.targets.wheel.force-include]
55
+ "LICENSE" = "LICENSE"
56
+ "THIRD_PARTY_NOTICES.md" = "THIRD_PARTY_NOTICES.md"