docs(readme): add presets.md

This commit is contained in:
Micooz 2017-04-22 21:49:06 +08:00
parent 9970f4ccef
commit e71327cbd8
4 changed files with 171 additions and 48 deletions

@ -43,7 +43,7 @@ module.exports = {
transport: 'tcp',
host: "bs.example.com",
port: 6858,
key: "j+b3)I<h#c1_Jl^c",
key: "qtPb2edK7yd7e]<K",
presets: [
{name: "ss-base", params: {}},
{name: "ss-aead-cipher", params: {method: "aes-256-gcm", info: "ss-subkey"}}
@ -58,11 +58,19 @@ module.exports = {
## Documents
### For Users
1. [Getting Started](docs/tutorials)
2. [Usage](docs/usage)
3. [Configuration](docs/config)
4. [Development](docs/development)
5. [Performance](docs/performance)
4. [Presets](docs/presets)
### For Developers
1. [Preparation](docs/development/preparation)
2. [Principle](docs/development/principle)
3. [Architecture](docs/development/architecture)
4. [Performance](docs/performance)
## Contributors

@ -5,6 +5,7 @@
1. [Getting Started](tutorials)
2. [Usage](usage)
3. [Configuration](config)
4. [Presets](presets)
## For Developers

@ -165,7 +165,7 @@ Blinksocks will detect which server is the fastest in intervals using [balancer.
`presets` are chaining from the first to the last, and are almost free to compose.
Please check out relevant [presets](../../src/presets), they are documented well.
For more information about presets, please check out [presets](../presets).
* Log Levels
@ -203,47 +203,3 @@ from client.
```
If `redirect` is not provided, connection will be closed after random seconds when server fail to process.
## Work with shadowsocks
To work with **shadowsocks**, please choose one of the following configuration:
**Steam Ciphers(Older Versions)**
```
{
...
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-stream-cipher",
"params": {
"method": "aes-256-cfb"
}
}],
...
}
```
**AEAD Ciphers(Newer Versions)**
```
{
...
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-aead-cipher",
"params": {
"method": "aes-256-gcm",
"info": "ss-subkey"
}
}],
...
}
```
Please also check out [#27](https://github.com/blinksocks/blinksocks/issues/27) for ciphers we've
already implemented.

158
docs/presets/README.md Normal file

@ -0,0 +1,158 @@
# Presets
Presets are chaining and composable, built-in presets are listed here.
If you want custom a preset, feel free to read [this](../development/architecture#Preset) first.
## [ss-base](../../src/presets/ss-base.js)
This is a very basic preset which delivers the real destination address from
blinksocks client to blinksocks server, and **MUST BE** the first one in the presets list.
## [ss-stream-cipher](../../src/presets/ss-stream-cipher.js)
The shadowsocks's [stream cipher](https://shadowsocks.org/en/spec/Stream-Ciphers.html).
| PARAMS | DESCRIPTION |
| :-------- | :------------------------------- |
| method | encryption and decryption method |
`method` can be one of:
aes-128-ctr, aes-192-ctr, aes-256-ctr,
aes-128-cfb, aes-192-cfb, aes-256-cfb,
aes-128-ofb, aes-192-ofb, aes-256-ofb,
aes-128-cbc, aes-192-cbc, aes-256-cbc
camellia-128-cfb, camellia-192-cfb, camellia-256-cfb
## [ss-aead-cipher](../../src/presets/ss-aead-cipher.js)
The shadowsocks's [aead cipher](https://shadowsocks.org/en/spec/AEAD-Ciphers.html).
| PARAMS | DESCRIPTION |
| :-------- | :------------------------------- |
| method | encryption and decryption method |
| info | a string to generate subkey |
`method` can be one of:
aes-128-gcm, aes-192-gcm, aes-256-gcm
If you want to work with shadowsocks client/server, the `info` must be **"ss-subkey"** without quotes.
Otherwise, it can be any string.
## [obfs-http](../../src/presets/obfs-http.js)
A http obfuscator, the first round after TCP handshake will wrap data within a random http header
selected from a text file.
| PARAMS | DESCRIPTION |
| :-------- | :-------------------------------------------- |
| file | a text file which contains HTTP header paris. |
`file` for example:
```
======================
GET / HTTP/1.1
Host: bing.com
Accept: */*
----------------------
HTTP/1.1 200 OK
Content-Type: text/plain
======================
POST /login HTTP/1.1
Host: login.live.com
Content-type: application/json
----------------------
HTTP/1.1 200 OK
======================
```
## [obfs-tls1.2-ticket](../../src/presets/obfs-tls1.2-ticket.js)
A TLS obfuscator, do TLS handshake using SessionTicket TLS mechanism, transfer data inside of Application Data.
| PARAMS | DESCRIPTION |
| :-------- | :----------------------------------------------------------------------------- |
| sni | [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication) |
# Recommended Combinations
## Work with shadowsocks
To work with **shadowsocks**, please choose one of the following configuration:
**Steam Ciphers(Older Versions)**
```json
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-stream-cipher",
"params": {
"method": "aes-256-cfb"
}
}]
```
**AEAD Ciphers(Newer Versions)**
```json
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-aead-cipher",
"params": {
"method": "aes-256-gcm",
"info": "ss-subkey"
}
}]
```
Please also check out [#27](https://github.com/blinksocks/blinksocks/issues/27) for ciphers we've already implemented.
## Avoid QoS
You can use **http** or **tls** obfuscator to avoid bad [QoS](https://en.wikipedia.org/wiki/Quality_of_service), **tls** is recommended.
```json
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-aead-cipher",
"params": {
"method": "aes-256-gcm",
"info": "ss-subkey"
}
}, {
"name": "obfs-http",
"params": {
"file": "http-fake.txt"
}
}]
```
```json
"presets": [{
"name": "ss-base",
"params": {}
}, {
"name": "ss-aead-cipher",
"params": {
"method": "aes-256-gcm",
"info": "ss-subkey"
}
}, {
"name": "obfs-tls1.2-ticket",
"params": {
"sni": "www.bing.com"
}
}]
```