@@ -10,7 +10,7 @@ python-proxy
1010.. |Hit-Count | image :: http://hits.dwyl.io/qwj/python-proxy.svg
1111 :target: https://pypi.python.org/pypi/pproxy/
1212
13- HTTP/Socks4/Socks5/Shadowsocks/ShadowsocksR/Redirect asynchronous tunnel proxy implemented in Python3 asyncio.
13+ HTTP/Socks4/Socks5/Shadowsocks/ShadowsocksR/Redirect/Pf asynchronous tunnel proxy implemented in Python3 asyncio.
1414
1515QuickStart
1616----------
@@ -138,6 +138,35 @@ Usage
138138
139139 Online help: <https://github.com/qwj/python-proxy>
140140
141+ Protocols
142+ ---------
143+
144+ +-------------------+------------+-----------+-------------+
145+ | Name | server | client | scheme |
146+ +===================+============+===========+=============+
147+ | http (connect) | ✔ | ✔ | http:// |
148+ +-------------------+------------+-----------+-------------+
149+ | http (get,post) | ✔ | ✖ | http:// |
150+ +-------------------+------------+-----------+-------------+
151+ | https | ✔ | ✔ | http+ssl:// |
152+ +-------------------+------------+-----------+-------------+
153+ | socks4 | ✔ | ✔ | socks4:// |
154+ +-------------------+------------+-----------+-------------+
155+ | socks5 | ✔ | ✔ | socks5:// |
156+ +-------------------+------------+-----------+-------------+
157+ | shadowsocks | ✔ | ✔ | ss:// |
158+ +-------------------+------------+-----------+-------------+
159+ | shadowsocks aead | ✔ | ✔ | ss:// |
160+ +-------------------+------------+-----------+-------------+
161+ | shadowsocksR | ✔ | ✔ | ssr:// |
162+ +-------------------+------------+-----------+-------------+
163+ | iptables nat | ✔ | | redir:// |
164+ +-------------------+------------+-----------+-------------+
165+ | pfctl nat (macos) | ✔ | | pf:// |
166+ +-------------------+------------+-----------+-------------+
167+ | AUTO DETECT | ✔ | | a+b+c+d:// |
168+ +-------------------+------------+-----------+-------------+
169+
141170URI Syntax
142171----------
143172
@@ -162,6 +191,8 @@ URI Syntax
162191 +--------+-----------------------------+
163192 | redir | redirect (iptables nat) |
164193 +--------+-----------------------------+
194+ | pf | pfctl (macos pf nat) |
195+ +--------+-----------------------------+
165196 | ssl | unsecured ssl/tls (no cert) |
166197 +--------+-----------------------------+
167198 | secure | secured ssl/tls (cert) |
@@ -387,9 +418,9 @@ Examples
387418
388419 $ pproxy -i ss://:8000/@in -r ss://111.0.0.2:8000/@111.0.0.1?rule1 -r ss://222.0.0.2:8000/@222.0.0.1?rule2
389420
390- - Redirect protocol
421+ - Redirect/Pf protocol
391422
392- IPtable NAT redirect example:
423+ IPTable NAT redirect example (Ubuntu) :
393424
394425 .. code :: rst
395426
@@ -398,6 +429,18 @@ Examples
398429
399430 The above example illustrates how to redirect all local output tcp traffic with destination port 80 to localhost port 5555 listened by **pproxy **, and then tunnel the traffic to remote http proxy.
400431
432+ PF redirect example (MacOS):
433+
434+ .. code :: rst
435+
436+ $ sudo pfctl -ef /dev/stdin
437+ rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
438+ pass out on en0 route-to lo0 inet proto tcp from any to any port 80 keep state
439+ ^D
440+ $ sudo pproxy -i pf://:8080 -r socks5://remote_socks5_server:1324 -v
441+
442+ Make sure **pproxy ** runs in root mode (sudo), otherwise it cannot redirect pf packet.
443+
401444- Relay tunnel
402445
403446 Relay tunnel example:
0 commit comments