X Tutup
Skip to content

Commit 0c8a04b

Browse files
authored
v1.9.5
1 parent 1b4dfca commit 0c8a04b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

README.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ QuickStart
1818
.. code:: rst
1919
2020
$ pip3 install pproxy
21-
Successfully installed pproxy-1.7.0
21+
Successfully installed pproxy-1.9.5
2222
$ pproxy
2323
Serving on :8080 by http,socks4,socks5
2424
^C
@@ -50,9 +50,8 @@ Apply CLI proxy: (MacOS, Linux)
5050
$ export http_proxy=http://localhost:8080
5151
$ export https_proxy=http://localhost:8080
5252
53-
5453
Run With Docker
55-
----------
54+
---------------
5655

5756
`pproxy` Docker container comes with C optimizations pre-installed.
5857

@@ -81,6 +80,7 @@ Features
8180
- System proxy auto-setting support.
8281
- UDP proxy client/server support.
8382
- Schedule (load balance) among remote servers.
83+
- Client UDP/TCP API support.
8484

8585
.. _One-Time-Auth: https://shadowsocks.org/en/spec/one-time-auth.html
8686

@@ -349,6 +349,29 @@ URIs can be joined by "__" to indicate tunneling by relay. For example, ss://1.2
349349

350350
.. _AEAD: http://shadowsocks.org/en/spec/AEAD-Ciphers.html
351351

352+
Client API
353+
----------
354+
355+
- TCP Client API
356+
357+
.. code:: rst
358+
359+
conn = pproxy.Connection('ss://aes-256-cfb:password@remote_host:remote_port')
360+
reader, writer = await conn.tcp_connect('google.com', 80)
361+
writer.write(b'GET / HTTP/1.1\r\n\r\n')
362+
data = await reader.read(1024*16)
363+
print(data.decode())
364+
365+
- UDP Client API
366+
367+
.. code:: rst
368+
369+
conn = pproxy.Connection('ss://chacha20:password@remote_host:remote_port')
370+
answer = asyncio.Future()
371+
await conn.udp_sendto('8.8.8.8', 53, b'hello the world', answer.set_result)
372+
await answer
373+
print(answer.result())
374+
352375
Examples
353376
--------
354377

0 commit comments

Comments
 (0)
X Tutup