X Tutup
Skip to content

Commit b994971

Browse files
authored
pfctl support
1 parent 2d5d691 commit b994971

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

README.rst

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1515
QuickStart
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+
141170
URI 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:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ def find_version(*file_paths):
3434
'Topic :: Software Development :: Build Tools',
3535
'License :: OSI Approved :: MIT License',
3636
'Programming Language :: Python :: 3',
37+
'Programming Language :: Python :: 3.6',
3738
'Programming Language :: Python :: 3.7',
3839
],
39-
keywords='proxy socks http shadowsocks redirect tunnel cipher ssl',
40+
keywords='proxy socks http shadowsocks shadowsocksr ssr redirect tunnel cipher ssl',
4041
packages=['pproxy'],
4142
extras_require={
4243
'accelerated': [

0 commit comments

Comments
 (0)
X Tutup