Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit da0f314

Browse files
committed
add different encryption method support
1 parent 72fea95 commit da0f314

File tree

4 files changed

+369
-315
lines changed

4 files changed

+369
-315
lines changed

README.md

+28-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ echo 'LISTEN_PORT = 4001' >> .env
4949

5050
#### Run shadowsocks-libev:
5151
```
52-
ss-manager -m aes-256-cfb -u --manager-address /tmp/shadowsocks-manager.sock --fast-open
52+
ss-manager -u --manager-address /tmp/shadowsocks-manager.sock --fast-open
5353
```
5454

5555
#### Run shadowsocks-restful-api:
@@ -105,14 +105,36 @@ Response example:
105105
| Request method: | POST |
106106
| Request URL: | https://host_name:port/ |
107107
| Request Header: | Content-Type: application/json <br> Authorization: Bearer your_authentication_toke |
108-
| Request Body: | {"port": port_number, "password":"port_password"} |
108+
| Request Body: | {"port": port_number, "password": "port_password", "method": "encryption_method"} |
109109
| Response HTTP Status Code: | 201 Created |
110110
| Response Error Status Code: | 401 Unauthorized <br> 409 (port already exists from shadowsocks) <br> 410 (port not available from operating system) <br> 422 (shadowsocks failed adding port) <br> 427 (operating system failed adding port) 424 (shadowsocks unreachable) <br> 425 (shadowsocks no response) <br> 500 Internal Server Error |
111111

112112
Request example (curl):
113113
```
114-
curl -ik -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1Mjk0ODg0MTcsImV4cCI6MTUyOTU3NDgxN30.9wdDV4hXvHdCkWhcOFpW2YXvSL6WupWSj2kTI6XMhFk" -X POST -d '{"port": 50000,"password":"2owkq9wu2elwst7"}' https://localhost:4001/
115-
```
114+
curl -ik -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1Mjk0ODg0MTcsImV4cCI6MTUyOTU3NDgxN30.9wdDV4hXvHdCkWhcOFpW2YXvSL6WupWSj2kTI6XMhFk" -X POST -d '{"port": 50000,"password":"2owkq9wu2elwst7","method":"chacha20-ietf-poly1305"}' https://localhost:4001/
115+
```
116+
117+
Supported encryption methods are:
118+
* `aes-128-gcm`
119+
* `aes-192-gcm`
120+
* `aes-256-gcm`
121+
* `aes-128-cfb`
122+
* `aes-192-cfb`
123+
* `aes-256-cfb`
124+
* `aes-128-ctr`
125+
* `aes-192-ctr`
126+
* `aes-256-ctr`
127+
* `camellia-128-cfb`
128+
* `camellia-192-cfb`
129+
* `camellia-256-cfb`
130+
* `bf-cfb`
131+
* `chacha20-ietf-poly1305`
132+
* `xchacha20-ietf-poly1305`
133+
* `salsa20`
134+
* `chacha20`
135+
* `chacha20-ietf`
136+
137+
If the `method` field is not supplied, the default method is `aes-256-cfb`.
116138

117139
#### Delete a port
118140
| | |
@@ -135,7 +157,7 @@ curl -ik -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQi
135157
| Request URL: | https://host_name:port/all |
136158
| Request Header: | Authorization: Bearer your_authentication_toke |
137159
| Response HTTP Status Code: | 200 OK |
138-
| Response Body: | [{"port":port_number, "password":"port_password"}, ... ] |
160+
| Response Body: | [{"port":port_number, "password":"port_password","method":"encryption_method"}, ... ] |
139161
| Response Error Status Code: | 401 Unauthorized <br>424 (shadowsocks unreachable) <br> 425 (shadowsocks no response) <br> 500 Internal Server Error |
140162

141163
Request example (curl):
@@ -144,7 +166,7 @@ curl -ik -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQi
144166
```
145167
Response example:
146168
```json
147-
[{"port": 50000,"password":"2owkq9wu2elwst7"}, {"port": 50001,"password":"dowl3829j3suniw6"}]
169+
[{"port": 50000,"password":"2owkq9wu2elwst7","method":"chacha20-ietf-poly1305"}, {"port": 50001,"password":"dowl3829j3suniw6","method":"aes-256-cfb"}]
148170
```
149171

150172
#### Get traffic for all ports

0 commit comments

Comments
 (0)