Skip to content

Commit 6c71230

Browse files
authored
add cipher key demonstration
1 parent a889e6e commit 6c71230

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,29 @@ Features
1414
- This utility can automatically detect incoming protocol from HTTP/Socks5/PSocks.
1515
- Implemented basic authentication method for HTTP/Socks5/PSocks.
1616
- Regex pattern file support for redirecting/blocking the incoming hosts.
17+
- Stream cipher chacha20 support to communicate with remote server securely.
1718
- Basic statistics for bandwidth and total traffic by client/hostname
1819

1920
Usage
2021
-----------
2122

2223
$ python3.6 pproxy.py -h
23-
usage: pproxy.py [-h] [-p PORT] [-t TYPES] [-a AUTH] [-rs RSERVER] [-rt RTYPE]
24-
[-ra RAUTH] [-m MATCH] [-b BLOCK] [-v]
25-
24+
usage: pproxy.py [-h] [-p PORT] [-t TYPES] [-a AUTH] [-c CIPHER] [-rs RSERVER]
25+
[-rt RTYPE] [-ra RAUTH] [-rc RCIPHER] [-m MATCH] [-b BLOCK]
26+
[-v]
27+
2628
Proxy server that can tunnel by http,socks,psocks protocol.
27-
29+
2830
optional arguments:
2931
-h, --help show this help message and exit
3032
-p PORT listen port server bound to (default: 8080)
3133
-t TYPES proxy server protocols (default: socks,http)
3234
-a AUTH authentication requirement
35+
-c CIPHER cipher key (default: no cipher)
3336
-rs RSERVER remote server address (default: direct)
3437
-rt RTYPE remote server type (default: psocks)
3538
-ra RAUTH remote authorization code
39+
-rc RCIPHER remote cipher key (default: no cipher)
3640
-m MATCH match pattern file
3741
-b BLOCK block pattern file
3842
-v print verbose output
@@ -60,8 +64,17 @@ We can define file "rules" as follow:
6064

6165
Then start the pproxy.py
6266

63-
python3.6 pserver.py -rs aa.bb.cc.dd:8080 -rt http -m rules -v
67+
python3.6 pproxy.py -rs aa.bb.cc.dd:8080 -rt http -m rules -v
6468

6569
With these parameters, this utility will serve incoming traffic by either http/socks5 protocol, redirect all google traffic to http proxy aa.bb.cc.dd:8080, and visit all other traffic locally.
6670

71+
To bridge two servers, add cipher key to ensure data can't be intercepted. First, run pproxy.py locally
72+
73+
python3.6 pproxy.py -rs aa.bb.cc.dd:12345 -rt psocks -rc "This is a cipher key" -m rules -v
74+
75+
Next, run pproxy.py remotely on server "aa.bb.cc.dd"
76+
77+
python3.6 pproxy.py -p 12345 -t psocks -rc "This is a cipher key"
78+
79+
By doing this, the traffic between local and aa.bb.cc.dd is encrypted by stream cipher Chacha20 with key "This is a cipher key". If target hostname is not in "rules", traffic will go through locally. Otherwise, traffic will go through the remote server by encryption.
6780

0 commit comments

Comments
 (0)