2023-05-05 11:03:58 +02:00
|
|
|
|
Index: proxy.py-2.4.3/README.md
|
2021-12-14 19:17:59 +01:00
|
|
|
|
===================================================================
|
2023-05-05 11:03:58 +02:00
|
|
|
|
--- proxy.py-2.4.3.orig/README.md
|
|
|
|
|
+++ proxy.py-2.4.3/README.md
|
|
|
|
|
@@ -370,14 +370,14 @@ Updated formulae for `HomeBrew` are main
|
2021-12-14 19:17:59 +01:00
|
|
|
|
## From command line when installed using PIP
|
|
|
|
|
|
|
|
|
|
When `proxy.py` is installed using `pip`,
|
|
|
|
|
-an executable named `proxy` is placed under your `$PATH`.
|
|
|
|
|
+an executable named `proxy-py` is placed under your `$PATH`.
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
### Run it
|
2021-12-14 19:17:59 +01:00
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
-Simply type `proxy` on command line to start with default configuration.
|
|
|
|
|
+Simply type `proxy-py` on command line to start with default configuration.
|
2021-12-14 19:17:59 +01:00
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy
|
|
|
|
|
+❯ proxy-py
|
2023-05-05 11:03:58 +02:00
|
|
|
|
...[redacted]... - Loaded plugin proxy.http.proxy.HttpProxyPlugin
|
|
|
|
|
...[redacted]... - Started 8 threadless workers
|
|
|
|
|
...[redacted]... - Started 8 acceptors
|
|
|
|
|
@@ -417,7 +417,7 @@ All the logs above are `INFO` level logs
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Lets start `proxy.py` with `DEBUG` level logging:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy --log-level d
|
|
|
|
|
+❯ proxy-py --log-level d
|
|
|
|
|
...[redacted]... - Open file descriptor soft limit set to 1024
|
|
|
|
|
...[redacted]... - Loaded plugin proxy.http_proxy.HttpProxyPlugin
|
|
|
|
|
...[redacted]... - Started 8 workers
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -442,7 +442,7 @@ See [flags](#flags) for full list of ava
|
2021-12-14 19:17:59 +01:00
|
|
|
|
## From command line using repo source
|
|
|
|
|
|
|
|
|
|
If you are trying to run `proxy.py` from source code,
|
|
|
|
|
-there is no binary file named `proxy` in the source code.
|
|
|
|
|
+there is no binary file named `proxy-py` in the source code.
|
|
|
|
|
|
|
|
|
|
To start `proxy.py` from source code follow these instructions:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -526,7 +526,7 @@ Add support for short links in your favo
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ShortLinkPlugin
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -555,7 +555,7 @@ Modifies POST request body before sendin
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ModifyPostDataPlugin
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -609,7 +609,7 @@ without need of an actual upstream REST
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ProposedRestApiPlugin
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -640,7 +640,7 @@ also running on `8899` port.
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` and enable inbuilt web server:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--enable-web-server \
|
|
|
|
|
--plugins proxy.plugin.RedirectToCustomServerPlugin
|
|
|
|
|
```
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -674,7 +674,7 @@ By default, plugin drops traffic for `fa
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.FilterByUpstreamHostPlugin
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -707,7 +707,7 @@ Caches Upstream Server Responses.
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.CacheResponsesPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -785,7 +785,7 @@ Modifies upstream server responses.
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ManInTheMiddlePlugin
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -810,18 +810,18 @@ Let's start 2 upstream proxies first. T
|
|
|
|
|
start `proxy.py` on port `9000` and `9001`
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --port 9000
|
|
|
|
|
+❯ proxy-py --port 9000
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --port 9001
|
|
|
|
|
+❯ proxy-py --port 9001
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Now, start `proxy.py` with `ProxyPoolPlugin` (on default `8899` port),
|
|
|
|
|
pointing to our upstream proxies at `9000` and `9001` port.
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ProxyPoolPlugin \
|
|
|
|
|
--proxy-pool localhost:9000 \
|
|
|
|
|
--proxy-pool localhost:9001
|
|
|
|
|
@@ -846,7 +846,7 @@ plugin blocks traffic from `127.0.0.1` a
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.FilterByClientIpPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -871,7 +871,7 @@ This plugin demonstrate how to modify ch
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ModifyChunkResponsePlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -903,7 +903,7 @@ does not provide that yet, so we use a d
|
|
|
|
|
Now start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.CloudflareDnsResolverPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -919,7 +919,7 @@ to your taste. Example, query your cust
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.CustomDnsResolverPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -941,7 +941,7 @@ If identified, client IP in the access l
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.ProgramNamePlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -970,7 +970,7 @@ Demonstrates inbuilt web server routing
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --enable-web-server \
|
|
|
|
|
+❯ proxy-py --enable-web-server \
|
|
|
|
|
--plugins proxy.plugin.WebServerPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -989,7 +989,7 @@ Extends in-built Web Server to add Rever
|
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --enable-reverse-proxy \
|
|
|
|
|
+❯ proxy-py --enable-reverse-proxy \
|
|
|
|
|
--plugins proxy.plugin.ReverseProxyPlugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
@@ -1046,7 +1046,7 @@ make https-certificates
|
2021-12-14 19:17:59 +01:00
|
|
|
|
Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--cert-file https-cert.pem \
|
|
|
|
|
--key-file https-key.pem
|
|
|
|
|
```
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -1095,7 +1095,7 @@ Lets also enable `CacheResponsePlugin` s
|
2021-12-14 19:17:59 +01:00
|
|
|
|
response from the server. Start `proxy.py` as:
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy \
|
|
|
|
|
+❯ proxy-py \
|
|
|
|
|
--plugins proxy.plugin.CacheResponsesPlugin \
|
|
|
|
|
--ca-key-file ca-key.pem \
|
|
|
|
|
--ca-cert-file ca-cert.pem \
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -1297,7 +1297,7 @@ Start `proxy.py` as:
|
2021-12-14 19:17:59 +01:00
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
❯ # On localhost
|
|
|
|
|
-❯ proxy --enable-tunnel \
|
|
|
|
|
+❯ proxy-py --enable-tunnel \
|
|
|
|
|
--tunnel-username username \
|
|
|
|
|
--tunnel-hostname ip.address.or.domain.name \
|
|
|
|
|
--tunnel-port 22 \
|
2023-05-05 11:03:58 +02:00
|
|
|
|
@@ -1757,7 +1757,7 @@ Also build the embedded `Chrome DevTools
|
|
|
|
|
Now start `proxy.py` with dashboard plugin and by overriding root directory for static server:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --enable-dashboard --static-server-dir dashboard/public
|
|
|
|
|
+❯ proxy-py --enable-dashboard --static-server-dir dashboard/public
|
|
|
|
|
...[redacted]... - Loaded plugin proxy.http.server.HttpWebServerPlugin
|
|
|
|
|
...[redacted]... - Loaded plugin proxy.dashboard.dashboard.ProxyDashboard
|
|
|
|
|
...[redacted]... - Loaded plugin proxy.dashboard.inspect_traffic.InspectTrafficPlugin
|
|
|
|
|
@@ -1794,7 +1794,7 @@ For scenarios where you want direct acce
|
|
|
|
|
start `proxy.py` as:
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
-❯ proxy --enable-devtools --enable-events
|
|
|
|
|
+❯ proxy-py --enable-devtools --enable-events
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Now point your CDT instance to `ws://localhost:8899/devtools`.
|
|
|
|
|
@@ -2278,7 +2278,7 @@ To run standalone benchmark for `proxy.p
|
2021-12-14 19:17:59 +01:00
|
|
|
|
# Flags
|
|
|
|
|
|
2023-05-05 11:03:58 +02:00
|
|
|
|
```console
|
2021-12-14 19:17:59 +01:00
|
|
|
|
-❯ proxy -h
|
|
|
|
|
+❯ proxy-py -h
|
2023-05-05 11:03:58 +02:00
|
|
|
|
usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
|
|
|
|
|
[--tunnel-username TUNNEL_USERNAME]
|
|
|
|
|
[--tunnel-ssh-key TUNNEL_SSH_KEY]
|
|
|
|
|
Index: proxy.py-2.4.3/setup.cfg
|
2021-12-14 19:17:59 +01:00
|
|
|
|
===================================================================
|
2023-05-05 11:03:58 +02:00
|
|
|
|
--- proxy.py-2.4.3.orig/setup.cfg
|
|
|
|
|
+++ proxy.py-2.4.3/setup.cfg
|
|
|
|
|
@@ -109,7 +109,7 @@ install_requires =
|
|
|
|
|
|
|
|
|
|
[options.entry_points]
|
|
|
|
|
console_scripts =
|
|
|
|
|
- proxy = proxy:entry_point
|
|
|
|
|
+ proxy-py = proxy:entry_point
|
|
|
|
|
|
|
|
|
|
[options.package_data]
|
|
|
|
|
proxy =
|