@@ -10,15 +10,15 @@ 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/Pf asynchronous tunnel proxy implemented in Python3 asyncio.
13+ HTTP/Socks4/Socks5/Shadowsocks/ShadowsocksR/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python3 asyncio.
1414
1515QuickStart
1616----------
1717
1818.. code :: rst
1919
2020 $ pip3 install pproxy
21- Successfully installed pproxy-1.6.4
21+ Successfully installed pproxy-1.7.0
2222 $ pproxy
2323 Serving on :8080 by http,socks4,socks5
2424 ^C
@@ -71,6 +71,7 @@ Features
7171- Iptables NAT redirect packet tunnel.
7272- PyPy3 support with JIT speedup.
7373- System proxy auto-setting support.
74+ - UDP proxy client/server support.
7475
7576.. _One-Time-Auth : https://shadowsocks.org/en/spec/one-time-auth.html
7677
@@ -115,17 +116,19 @@ Usage
115116.. code :: rst
116117
117118 $ pproxy -h
118- usage: pproxy [-h] [-i LISTEN] [-r RSERVER] [-b BLOCK ] [-a ALIVED] [-v ]
119- [--ssl SSLFILE ] [--pac PAC ] [--get GETS ] [--sys ]
120- [--test TESTURL] [--version]
119+ usage: pproxy [-h] [-i LISTEN] [-r RSERVER] [-ui ULISTEN ] [-ur URSERVER ]
120+ [-b BLOCK ] [-a ALIVED ] [-v] [--ssl SSLFILE ] [--pac PAC ]
121+ [--get GETS] [--sys] [-- test TESTURL] [--version]
121122
122123 Proxy server that can tunnel among remote servers by regex rules. Supported
123- protocols: http,socks4,socks5,shadowsocks,shadowsocksr,redirect
124+ protocols: http,socks4,socks5,shadowsocks,shadowsocksr,redirect,pf,tunnel
124125
125126 optional arguments:
126127 -h, --help show this help message and exit
127- -i LISTEN proxy server setting uri (default: http+socks://:8080/)
128- -r RSERVER remote server setting uri (default: direct)
128+ -i LISTEN tcp server uri (default: http+socks4+socks5://:8080/)
129+ -r RSERVER tcp remote server uri (default: direct)
130+ -ui ULISTEN udp server setting uri (default: none)
131+ -ur URSERVER udp remote server uri (default: direct)
129132 -b BLOCK block regex rules
130133 -a ALIVED interval to check remote alive (default: no check)
131134 -v print verbose output
@@ -141,31 +144,36 @@ Usage
141144 Protocols
142145---------
143146
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- +-------------------+------------+-----------+-------------+
147+ +-------------------+------------+------------+------------+------------+--------------+
148+ | Name | TCP server | TCP client | UDP server | UDP client | scheme |
149+ +===================+============+============+============+============+==============+
150+ | http (connect) | ✔ | ✔ | | | http:// |
151+ +-------------------+------------+------------+------------+------------+--------------+
152+ | http (get,post) | ✔ | ✖ | | | http:// |
153+ +-------------------+------------+------------+------------+------------+--------------+
154+ | https | ✔ | ✔ | | | http+ssl:// |
155+ +-------------------+------------+------------+------------+------------+--------------+
156+ | socks4 | ✔ | ✔ | | | socks4:// |
157+ +-------------------+------------+------------+------------+------------+--------------+
158+ | socks5 | ✔ | ✔ | ✔ udp-only | ✔ udp-only | socks5:// |
159+ +-------------------+------------+------------+------------+------------+--------------+
160+ | shadowsocks | ✔ | ✔ | ✔ | ✔ | ss:// |
161+ +-------------------+------------+------------+------------+------------+--------------+
162+ | shadowsocks aead | ✔ | ✔ | | | ss:// |
163+ +-------------------+------------+------------+------------+------------+--------------+
164+ | shadowsocksR | ✔ | ✔ | | | ssr:// |
165+ +-------------------+------------+------------+------------+------------+--------------+
166+ | iptables nat | ✔ | | | | redir:// |
167+ +-------------------+------------+------------+------------+------------+--------------+
168+ | pfctl nat (macos) | ✔ | | | | pf:// |
169+ +-------------------+------------+------------+------------+------------+--------------+
170+ | echo | ✔ | | | | echo:// |
171+ +-------------------+------------+------------+------------+------------+--------------+
172+ | tunnel | ✔ | ✔ | ✔ | ✔ | tunnel:// |
173+ | (raw socket) | | | | | tunnel{ip}://|
174+ +-------------------+------------+------------+------------+------------+--------------+
175+ | AUTO DETECT | ✔ | | ✔ | | a+b+c+d:// |
176+ +-------------------+------------+------------+------------+------------+--------------+
169177
170178URI Syntax
171179----------
@@ -197,6 +205,10 @@ URI Syntax
197205 +--------+-----------------------------+
198206 | secure | secured ssl/tls (cert) |
199207 +--------+-----------------------------+
208+ | tunnel | raw connection |
209+ +--------+-----------------------------+
210+ | echo | echo-back service |
211+ +--------+-----------------------------+
200212 | direct | direct connection |
201213 +--------+-----------------------------+
202214
@@ -451,3 +463,36 @@ Examples
451463
452464 *pproxy * will connect to server1 first, tell server1 connect to server2, and tell server2 connect to server3, and make real traffic by server3.
453465
466+ - Raw connection tunnel
467+
468+ TCP raw connection tunnel example:
469+
470+ .. code :: rst
471+
472+ $ pproxy -i tunnel{google.com}://:80
473+ $ curl -H "Host: google.com" http://localhost
474+
475+ UDP dns tunnel example:
476+
477+ .. code :: rst
478+
479+ $ pproxy -ui tunnel{8.8.8.8}://:53
480+ $ nslookup google.com localhost
481+
482+ - UDP more complicated example
483+
484+ Run the shadowsocks udp proxy on remote machine:
485+
486+ .. code :: rst
487+
488+ $ pproxy -ui ss://remote_server:13245
489+
490+ Run the commands on local machine:
491+
492+ .. code :: rst
493+
494+ $ pproxy -ui tunnel{8.8.8.8}://:53 -ur ss://remote_server:13245
495+ UDP tunnel 127.0.0.1:60573 -> ss remote_server:13245 -> 8.8.8.8:53
496+ UDP tunnel 127.0.0.1:60574 -> ss remote_server:13245 -> 8.8.8.8:53
497+ ...
498+ $ nslookup google.com localhost
0 commit comments