Skip to content

[v2.4.3] Support for dynamic reverse proxy routes #1188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3e6609d
Merge pull request #1162 from abhinavsingh/master
abhinavsingh May 23, 2022
0c203f9
pip prod(deps): bump blacksheep from 1.2.2 to 1.2.7 (#1161)
dependabot[bot] May 24, 2022
2a2cd00
Bump fregante/setup-git-user from 1.0.1 to 1.1.0 (#1160)
dependabot[bot] May 24, 2022
2260235
npm: bump ts-node from 10.7.0 to 10.8.0 in /dashboard (#1159)
dependabot[bot] May 24, 2022
c7268b7
npm: bump ws from 8.5.0 to 8.6.0 in /dashboard (#1165)
dependabot[bot] May 24, 2022
5f1b108
Delete FUNDING.yml
abhinavsingh May 25, 2022
921f57c
pip prod(deps): bump pytest from 6.2.5 to 7.0.1 (#1164)
dependabot[bot] May 25, 2022
beddce0
pip prod(deps): bump rope from 0.22.0 to 1.1.1 (#1167)
dependabot[bot] May 26, 2022
0e7c48c
pip prod(deps): bump starlette from 0.17.1 to 0.19.1 (#1168)
dependabot[bot] May 26, 2022
c93b028
pip prod(deps): bump mypy from 0.940 to 0.960 (#1170)
dependabot[bot] May 27, 2022
9513ab7
Create FUNDING.yml
abhinavsingh May 31, 2022
fa748c9
Address yaml lint
abhinavsingh Jun 8, 2022
e8177f8
Bump actions/cache from 3.0.2 to 3.0.4 (#1185)
dependabot[bot] Jun 9, 2022
57bf518
Bump actions/setup-python from 3 to 4 (#1186)
dependabot[bot] Jun 9, 2022
223d29c
pip prod(deps): bump py-spy from 0.3.11 to 0.3.12 (#1174)
dependabot[bot] Jun 9, 2022
c3b966e
pip prod(deps): bump mypy from 0.960 to 0.961 (#1187)
dependabot[bot] Jun 10, 2022
7195b07
Add support for dynamic reverse proxy routing (#1180)
abhinavsingh Jun 11, 2022
91d6464
Merge branch 'master' into develop
abhinavsingh Jun 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
open_collective: proxypy
...
# These are supported funding model platforms

github: abhinavsingh
24 changes: 12 additions & 12 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
container-platforms: ${{ steps.container.outputs.platforms }}
steps:
- name: Switch to using Python 3.9 by default
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: >-
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- name: Set up pip cache
if: >-
steps.request-check.outputs.release-requested != 'true'
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: >-
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:

steps:
- name: Switch to using Python v3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: >-
Expand All @@ -244,7 +244,7 @@ jobs:
run: >-
echo "::set-output name=dir::$(pip cache dir)"
- name: Set up pip cache
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: >-
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
|| fromJSON(needs.pre-setup.outputs.release-requested)
uses: fregante/setup-git-user@v1.0.1
uses: fregante/setup-git-user@v1.1.0
- name: >-
Tag the release in the local Git repo
as ${{ needs.pre-setup.outputs.git-tag }}
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:

steps:
- name: Switch to using Python v3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: >-
Expand All @@ -369,7 +369,7 @@ jobs:
run: >-
echo "::set-output name=dir::$(pip cache dir)"
- name: Set up pip cache
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: >-
Expand Down Expand Up @@ -467,7 +467,7 @@ jobs:

steps:
- name: Switch to using Python v${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: >-
Expand All @@ -486,7 +486,7 @@ jobs:
run: >-
echo "::set-output name=dir::$(pip cache dir)"
- name: Set up pip cache
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: >-
Expand Down Expand Up @@ -670,7 +670,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Brew
Expand Down Expand Up @@ -724,7 +724,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Pip Dependencies
Expand Down Expand Up @@ -1057,7 +1057,7 @@ jobs:
fetch-depth: 1
ref: ${{ github.event.inputs.release-commitish }}
- name: Setup git user as [bot]
uses: fregante/setup-git-user@v1.0.1
uses: fregante/setup-git-user@v1.1.0

- name: >-
Tag the release in the local Git repo
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2315,9 +2315,9 @@ usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
[--filtered-client-ips FILTERED_CLIENT_IPS]
[--filtered-url-regex-config FILTERED_URL_REGEX_CONFIG]

proxy.py v2.4.2.dev11+g0beb02d.d20220420
proxy.py v2.4.3.dev14+gc6b2de6.d20220605

options:
optional arguments:
-h, --help show this help message and exit
--tunnel-hostname TUNNEL_HOSTNAME
Default: None. Remote hostname or IP address to which
Expand All @@ -2334,11 +2334,11 @@ options:
--tunnel-remote-port TUNNEL_REMOTE_PORT
Default: 8899. Remote port which will be forwarded
locally for proxy.
--threadless Default: True. Enabled by default on Python 3.8+ (mac,
linux). When disabled a new thread is spawned to
--threadless Default: False. Enabled by default on Python 3.8+
(mac, linux). When disabled a new thread is spawned to
handle each client connection.
--threaded Default: False. Disabled by default on Python < 3.8
and windows. When enabled a new thread is spawned to
--threaded Default: True. Disabled by default on Python < 3.8 and
windows. When enabled a new thread is spawned to
handle each client connection.
--num-workers NUM_WORKERS
Defaults to number of CPU cores.
Expand Down Expand Up @@ -2434,8 +2434,8 @@ options:
Default: None. Signing certificate to use for signing
dynamically generated HTTPS certificates. If used,
must also pass --ca-key-file and --ca-signing-key-file
--ca-file CA_FILE Default: /Users/abhinavsingh/Dev/proxy.py/venv310/lib/
python3.10/site-packages/certifi/cacert.pem. Provide
--ca-file CA_FILE Default: /Users/abhinavsingh/Dev/proxy.py/venv373/lib/
python3.7/site-packages/certifi/cacert.pem. Provide
path to custom CA bundle for peer certificate
verification
--ca-signing-key-file CA_SIGNING_KEY_FILE
Expand Down
4 changes: 2 additions & 2 deletions benchmark/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiohttp==3.8.1
blacksheep==1.2.2
starlette==0.17.1
blacksheep==1.2.7
starlette==0.19.1
tornado==6.1
uvicorn==0.16.0
112 changes: 72 additions & 40 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-javascript-obfuscator": "^1.0.4",
"rollup-plugin-typescript": "^1.0.1",
"ts-node": "^10.7.0",
"ts-node": "^10.8.0",
"typescript": "^4.5.4",
"ws": "^8.5.0"
"ws": "^8.6.0"
}
}
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
(_py_class_role, 'T'),
(_py_class_role, 'HostPort'),
(_py_class_role, 'TcpOrTlsSocket'),
(_py_class_role, 're.Pattern'),
(_py_obj_role, 'proxy.core.work.threadless.T'),
(_py_obj_role, 'proxy.core.work.work.T'),
(_py_obj_role, 'proxy.core.base.tcp_server.T'),
Expand Down
9 changes: 9 additions & 0 deletions proxy/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
import re
import ssl
import sys
import queue
import socket
import ipaddress
Expand All @@ -30,3 +32,10 @@
IpAddress = Union[ipaddress.IPv4Address, ipaddress.IPv6Address]
TcpOrTlsSocket = Union[ssl.SSLSocket, socket.socket]
HostPort = Tuple[str, int]

if sys.version_info.minor == 6:
RePattern = Any
elif sys.version_info.minor in (7, 8):
RePattern = re.Pattern # type: ignore
else:
RePattern = re.Pattern[Any] # type: ignore
Loading