From 538f8a52f6e8c96ea1d878735b688c5b75e4a300 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 22 Feb 2022 08:52:08 +0800 Subject: [PATCH] docs: details of Shadowsocks and ShadowsocksR --- ProxyBuilder/Shadowsocks.py | 57 ---------- ProxyBuilder/ShadowsocksR.py | 50 --------- ProxyFilter/Shadowsocks.py | 31 ------ ProxyFilter/ShadowsocksR.py | 30 ----- docs/ProxyObject.md | 208 +++++++++++++++++++++++++++++++++++ 5 files changed, 208 insertions(+), 168 deletions(-) create mode 100644 docs/ProxyObject.md diff --git a/ProxyBuilder/Shadowsocks.py b/ProxyBuilder/Shadowsocks.py index 9d335e6..3950c76 100644 --- a/ProxyBuilder/Shadowsocks.py +++ b/ProxyBuilder/Shadowsocks.py @@ -1,63 +1,6 @@ #!/usr/bin/python # -*- coding:utf-8 -*- -""" -# Shadowsocks构建器 - -## 节点格式 - -```json -{ - "server": "...", - "port": ..., - "method": "...", - "passwd": "...", - "plugin": pluginObject -} -``` - -+ server (str) -> 必选, 服务器地址 (IPv4 / IPv6 / Domain) - -+ port (int) -> 必选, 服务器端口 (1 ~ 65535) - -+ method (str) -> 必选, Shadowsocks加密方式 (`aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`, - `aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`, - `aes-128-ocb`,`aes-192-ocb`,`aes-256-ocb`, - `aes-128-ofb`,`aes-192-ofb`,`aes-256-ofb`, - `aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`, - `aes-128-cfb1`,`aes-192-cfb1`,`aes-256-cfb1`, - `aes-128-cfb8`,`aes-192-cfb8`,`aes-256-cfb8`, - `aes-128-cfb128`,`aes-192-cfb128`,`aes-256-cfb128`, - `camellia-128-cfb`,`camellia-192-cfb`,`camellia-256-cfb`, - `camellia-128-cfb128`,`camellia-192-cfb128`,`camellia-256-cfb128`, - `plain`,`none`,`table`,`rc4`,`rc4-md5`,`rc2-cfb`,`bf-cfb`, - `cast5-cfb`,`des-cfb`,`idea-cfb`,`seed-cfb`,`salsa20`,`salsa20-ctr`, - `xchacha20`,`chacha20`,`chacha20-ietf`,`chacha20-poly1305`, - `chacha20-ietf-poly1305`,`xchacha20-ietf-poly1305`) - -+ passwd (str) -> 必选, Shadowsocks连接密码 - -+ plugin (pluginObject) -> 必选, Shadowsocks连接插件 - -### pluginObject (None / dict) - -无插件: None - -带插件: - -```json -{ - "type": "...", - "param": "..." -} -``` - -+ type (str) -> 插件名称 - -+ param (str) -> 插件参数 - -""" - import json ssMethodList = { # Shadowsocks各版本加密方式支持 diff --git a/ProxyBuilder/ShadowsocksR.py b/ProxyBuilder/ShadowsocksR.py index c1289c0..74fb635 100644 --- a/ProxyBuilder/ShadowsocksR.py +++ b/ProxyBuilder/ShadowsocksR.py @@ -1,56 +1,6 @@ #!/usr/bin/python # -*- coding:utf-8 -*- -""" -# ShadowsocksR构建器 - -## 节点格式 - -```json -{ - "server": "...", - "port": ..., - "method": "...", - "passwd": "...", - "protocol": "...", - "protocolParam": "...", - "obfs": "...", - "obfsParam": "..." -} -``` - -+ server (str) -> 必选, 服务器地址 (IPv4 / IPv6 / Domain) - -+ port (int) -> 必选, 服务器端口 (1 ~ 65535) - -+ method (str) -> 必选, ShadowsocksR加密方式 (`aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`, - `aes-128-cfb1`,`aes-192-cfb1`,`aes-256-cfb1`, - `aes-128-cfb8`,`aes-192-cfb8`,`aes-256-cfb8`, - `aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`, - `aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`, - `aes-128-ofb`,`aes-192-ofb`,`aes-256-ofb`, - `camellia-128-cfb`,`camellia-192-cfb`,`camellia-256-cfb`, - `none`,`table`,`rc4`,`rc4-md5`,`rc4-md5-6`,`bf-cfb`, - `cast5-cfb`,`des-cfb`,`idea-cfb`,`seed-cfb`,`rc2-cfb`, - `salsa20`,`xsalsa20`,`chacha20`,`xchacha20`,`chacha20-ietf`) - -+ passwd (str) -> 必选, ShadowsocksR连接密码 - -+ protocol (str) -> 必选, ShadowsocksR连接协议 (`origin`,`verify_sha1`,`verify_simple`,`verify_deflate`, - `auth_simple`,`auth_sha1`,`auth_sha1_v2`,`auth_sha1_v4`, - `auth_aes128`,`auth_aes128_md5`,`auth_aes128_sha1`, - `auth_chain_a`,`auth_chain_b`,`auth_chain_c`, - `auth_chain_d`,`auth_chain_e`,`auth_chain_f`) - -+ protocolParam (str) -> 必选, ShadowsocksR协议参数 - -+ obfs (str) -> 必选, ShadowsocksR混淆方式 (`plain`,`http_post`,`http_simple`,`tls_simple`, - `tls1.2_ticket_auth`,`tls1.2_ticket_fastauth`,`random_head`) - -+ obfsParam (str) -> 必选, ShadowsocksR混淆参数 - -""" - import json ssrMethodList = [ # ShadowsocksR加密方式 diff --git a/ProxyFilter/Shadowsocks.py b/ProxyFilter/Shadowsocks.py index b624498..f69ded2 100644 --- a/ProxyFilter/Shadowsocks.py +++ b/ProxyFilter/Shadowsocks.py @@ -1,37 +1,6 @@ #!/usr/bin/python # -*- coding:utf-8 -*- -""" - -{ - 'server': '...', - 'port': ..., - 'method': '...', - 'passwd': '...', - 'plugin': pluginObject -} - -server (str) -> required - -port (int or str) -> required - -method (str) -> required - -passwd (str) -> required - -plugin (None or dict) -> optional - -pluginObject: { - 'type': '...', - 'param': '...' -} - -type (str) -> optional - -param (str) -> optional - -""" - from ProxyFilter import baseFunc from ProxyFilter import Plugin as sip003 diff --git a/ProxyFilter/ShadowsocksR.py b/ProxyFilter/ShadowsocksR.py index c37c94e..2d77d35 100644 --- a/ProxyFilter/ShadowsocksR.py +++ b/ProxyFilter/ShadowsocksR.py @@ -1,36 +1,6 @@ #!/usr/bin/python # -*- coding:utf-8 -*- -""" -{ - 'server': '...', - 'port': ..., - 'method': '...', - 'passwd': '...', - 'protocol': '...', - 'protocolParam': '...', - 'obfs': '...', - 'obfsParam': '...' -} - -server (str) -> required - -port (int or str) -> required - -method (str) -> required - -passwd (str) -> required - -protocol (str) -> optional - -protocolParam (str) -> optional - -obfs (str) -> optional - -obfsParam (str) -> optional - -""" - from ProxyFilter import baseFunc ssrMethodList = [ # ShadowsocksR加密方式 diff --git a/docs/ProxyObject.md b/docs/ProxyObject.md new file mode 100644 index 0000000..555942a --- /dev/null +++ b/docs/ProxyObject.md @@ -0,0 +1,208 @@ +# 代理节点格式 + +``` +{ + 'type': ..., + ... +} +``` + +**type** + ++ 类型:*str* + ++ 说明:节点类型 + ++ 缺省:必选 + ++ 可选值:`ss`,`ssr` + +## Shadowsocks + +``` +{ + 'type': 'ss', + 'server': ..., + 'port': ..., + 'method': ..., + 'passwd': ..., + 'plugin': ... +} +``` + +**server** + ++ 类型:*str* + ++ 说明:服务器地址 + ++ 缺省:必选 + ++ 可选值:合法的IP地址或域名 + +**port** + ++ 类型:*int* + ++ 说明:服务器端口 + ++ 缺省:必选 + ++ 可选值:1 ~ 65535 + +**method** + ++ 类型:*str* + ++ 说明:Shadowsocks加密方式 + ++ 缺省:必选 + ++ 可选值:`aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`,`aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`,`aes-128-ocb`,`aes-192-ocb`,`aes-256-ocb`,`aes-128-ofb`,`aes-192-ofb`,`aes-256-ofb`,`aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`,`aes-128-cfb1`,`aes-192-cfb1`,`aes-256-cfb1`,`aes-128-cfb8`,`aes-192-cfb8`,`aes-256-cfb8`,`aes-128-cfb128`,`aes-192-cfb128`,`aes-256-cfb128`,`camellia-128-cfb`,`camellia-192-cfb`,`camellia-256-cfb`,`camellia-128-cfb128`,`camellia-192-cfb128`,`camellia-256-cfb128`,`plain`,`none`,`table`,`rc4`,`rc4-md5`,`rc2-cfb`,`bf-cfb`,`cast5-cfb`,`des-cfb`,`idea-cfb`,`seed-cfb`,`salsa20`,`salsa20-ctr`,`xchacha20`,`chacha20`,`chacha20-ietf`,`chacha20-poly1305`,`chacha20-ietf-poly1305`,`xchacha20-ietf-poly1305` + ++ 建议值:`aes-256-gcm`,`aes-128-gcm`,`chacha20-ietf-poly1305` + +**passwd** + ++ 类型:*str* + ++ 说明:Shadowsocks连接密码 + ++ 缺省:必选 + ++ 可选值:不限 + +**plugin** + ++ 类型:*None* / *pluginObject* + ++ 说明:SIP003插件 + ++ 缺省:None + ++ 可选值:不限 + +### pluginObject + +``` +{ + 'type': ..., + 'param': ... +} +``` + +**type** + ++ 类型:*str* + ++ 说明:SIP003插件名称 + ++ 缺省:必选 + ++ 可选值:`obfs-local`,`simple-tls`,`v2ray-plugin`,`xray-plugin`,`kcptun-client`,`gost-plugin`,`ck-client`,`gq-client`,`mtt-client`,`rabbit-plugin`,`qtun-client`,`gun-plugin` + +**param** + ++ 类型:*str* + ++ 说明:SIP003插件参数 + ++ 缺省:'' + ++ 可选值:不限 + +## ShadowsocksR + +``` +{ + 'type': 'ssr', + 'server': ..., + 'port': ..., + 'method': ..., + 'passwd': ..., + 'protocol': ..., + 'protocolParam': ..., + 'obfs': ..., + 'obfsParam': ... +} +``` + +**server** + ++ 类型:*str* + ++ 说明:服务器地址 + ++ 缺省:必选 + ++ 可选值:合法的IP地址或域名 + +**port** + ++ 类型:*int* + ++ 说明:服务器端口 + ++ 缺省:必选 + ++ 可选值:1 ~ 65535 + +**method** + ++ 类型:*str* + ++ 说明:ShadowsocksR加密方式 + ++ 缺省:必选 + ++ 可选值:`aes-128-cfb`,`aes-192-cfb`,`aes-256-cfb`,`aes-128-cfb1`,`aes-192-cfb1`,`aes-256-cfb1`,`aes-128-cfb8`,`aes-192-cfb8`,`aes-256-cfb8`,`aes-128-ctr`,`aes-192-ctr`,`aes-256-ctr`,`aes-128-gcm`,`aes-192-gcm`,`aes-256-gcm`,`aes-128-ofb`,`aes-192-ofb`,`aes-256-ofb`,`camellia-128-cfb`,`camellia-192-cfb`,`camellia-256-cfb`,`none`,`table`,`rc4`,`rc4-md5`,`rc4-md5-6`,`bf-cfb`,`cast5-cfb`,`des-cfb`,`idea-cfb`,`seed-cfb`,`rc2-cfb`,`salsa20`,`xsalsa20`,`chacha20`,`xchacha20`,`chacha20-ietf` + +**passwd** + ++ 类型:*str* + ++ 说明:ShadowsocksR连接密码 + ++ 缺省:必选 + ++ 可选值:不限 + +**protocol** + ++ 类型:*str* + ++ 说明:ShadowsocksR连接协议 + ++ 缺省:'origin' + ++ 可选值:`origin`,`verify_sha1`,`verify_simple`,`verify_deflate`,`auth_simple`,`auth_sha1`,`auth_sha1_v2`,`auth_sha1_v4`,`auth_aes128`,`auth_aes128_md5`,`auth_aes128_sha1`,`auth_chain_a`,`auth_chain_b`,`auth_chain_c`,`auth_chain_d`,`auth_chain_e`,`auth_chain_f` + +**protocolParam** + ++ 类型:*str* + ++ 说明:ShadowsocksR协议参数 + ++ 缺省:'' + ++ 可选值:不限 + +**obfs** + ++ 类型:*str* + ++ 说明:ShadowsocksR混淆方式 + ++ 缺省:'plain' + ++ 可选值:`plain`,`http_post`,`http_simple`,`tls_simple`,`tls1.2_ticket_auth`,`tls1.2_ticket_fastauth`,`random_head` + +**obfsParam** + ++ 类型:*str* + ++ 说明:ShadowsocksR混淆参数 + ++ 缺省:'' + ++ 可选值:不限