Skip to content

Instantly share code, notes, and snippets.

@NevadaCities
Forked from Un1Gfn/subscription.bak.md
Created June 26, 2021 06:35
Show Gist options
  • Save NevadaCities/e471e428a011e58070b6c43844a0f2d4 to your computer and use it in GitHub Desktop.
Save NevadaCities/e471e428a011e58070b6c43844a0f2d4 to your computer and use it in GitHub Desktop.
ShadowsocksD/SSD subscription specification
Terminology
en_US zh_CN
name/value pairs 字段
root object 主字段
subscription URL 订阅链接
server address 服务器地址
client 客户端
"Airport"(Proxy service provider) 机场

Translated from the original version in Simplified Chinese by Darren Wu.

GET the subscription link provided by your "Airport"(Proxy service provider) and you will get a URI. E.g.

ssd://eyJhaXJwb3J0IjoiU1NQQU5FTCIsInBvcnQiOjEwMjUsImVuY3J5cHRpb24iOiJhZXMtMTI4LWdjbSIsInBhc3N3b3JkIjoiRzZsODdGIiwic2VydmVycyI6W3siaWQiOjMsInNlcnZlciI6Ind3dy5nb29nbGUuY29tIiwicmVtYXJrcyI6Ilx1N2Y4ZVx1NTZmZCBBIiwicmF0aW8iOjF9LHsiaWQiOjQsInNlcnZlciI6Ind3dy5iYWlkdS5jb20iLCJyZW1hcmtzIjoiXHU0ZTJkXHU1NmZkQiIsInJhdGlvIjowLjV9XX0=

The ssd:// in the beginning indicates it's a SSD(ShadowsocksD) URI.

There may be ssd2://, ssd3://, ... in the future in case of any uncompatible changes.

The Base64 code may or may not end in one or more '='(s). If they appear, do not remove them becuase they should be an indispensable part of the Base64 code.

Clients should remove ssd://and decode the Base64 encoded string eyJ...X0= to get a JSON. E.g.

{"airport":"SSPANEL","port":1025,"encryption":"aes-128-gcm","password":"G6l87F","servers":[{"id":3,"server":"www.google.com","remarks":"\u7f8e\u56fd A","ratio":1},{"id":4,"server":"www.baidu.com","remarks":"\u4e2d\u56fdB","ratio":0.5}]}

Prettyprint it:

{
    "airport":"SSPANEL",
    "port":1025,
    "encryption":"aes-128-gcm",
    "password":"G6l87F",
    "servers":
    [
        {
            "id":3,
            "server":"www.google.com",
            "remarks":"\u7f8e\u56fd A",
            "ratio":1
        },
        {
            "id":4,
            "server":"www.baidu.com",
            "remarks":"\u4e2d\u56fdB",
            "ratio":0.5
        }
    ]
}

There are 3 types of name/value pairs:

Type Explanation
REQUIRED Always exists. Clients must handle it.
EXTEND Not always exists. Clients must handle it if it exists.
OPTIONAL Not always exists. Clients can ignore it even it exists.

It may look strange that EXTEND is a verb while REQUIRED and OPTIONAL are adjective, but that's the fact.

The root object may contain the following name/value pairs:

Name/value pair (w/ sample values) Type Description
"airport":"SSPANEL" REQUIRED Name of your Proxy service provider.
"port":1025 REQUIRED Default server port.
"encryption":"aes-128-gcm" REQUIRED Default encryption method/cipher. AEAD Ciphers support are REQUIRED. Support for other ciphers such as Stream Ciphers are OPTIONAL.
"password":"G6l87F" REQUIRED Default password.
"servers":[] REQUIRED Array of servers provided by your "Airport".
"plugin":"simple-obfs" EXTEND Default SIP003 plugin to use. The value should be one of "v2ray", "simple-obfs" or "kcptun". simple-obfs is abandoned by upstream (preceded by v2ray-plugin) while kcptun is currently unavailable on some OScitation needed. Client support for simple-obfs and kcptun are OPTIONAL.
"plugin_options":"obfs=tls..." EXTEND Default options for SIP003 plugin, if any.
"traffic_used":0.1 OPTIONAL Data usage (GB) at the time when the subscription link is requested⚠️
"traffic_total":0.1 OPTIONAL Your current data plan (GB). "-1" if you have an unlimited data plan.
"expiry":"2019-01-01 00:00:00" OPTIONAL When your account expires or when the subscription URL expires. Do not use illegal time strings such as 0000-00-00.
"url":"https://" OPTIONAL The subscription URL.

Each value in the servers array may contain the following name/value pairs

Name/value pair (w/ sample values) Type Description
"server":"www.google.com" REQUIRED Server’s hostname or IP
"port" EXTEND Overwrites default value in the root object
"encryption" EXTEND Overwrites default value in the root object
"password" EXTEND Overwrites default value in the root object
"plugin" EXTEND Overwrites default value in the root object
"plugin_options" EXTEND Overwrites default value in the root object
"id":3 OPTIONAL Unique ID of this server among all servers provided by your "Airport".
"remarks":"\u7f8e\u56fd A" OPTIONAL Remark/comment of the server. Usually it contains location information of the server. "\u7f8e\u56fd" is a Unicode string of "美国". 美国/The United States of America"
"ratio":1 OPTIONAL Traffic (data quota) deduction ratepoor translation. After using 1GB data, you'll get 0.5GB deducted from you total traffic if "ratio":0.5, or 2GB deducted from you total traffic if "ratio":2. Your "Airport" may introduce this rate to direct users to servers with lower load.

References:


CC0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment