-
Notifications
You must be signed in to change notification settings - Fork 599
Description
Shadowsocks Improvement Proposal 002 (actually why don't we just use issue number to refer to them instead)
Optional configurations as query strings in ss URLs
Since #26, there are at least two optional extension for shadowsocks as far as I can tell:
- Kcptun
- HTTP/TLS obfuscation
There may be more extensions in the future. So what about adding them to ss URLs? For example, we can have ss://...?kcpport=8839&kcpcli=--crypt+none......#a+name
for easier configuration. Clients that don't support the extensions can safely ignore them.
What should be included:
- Values that should be consistent with server configuration.
What shouldn't:
- Arbitrary values that can be configured by users, like whether the extension is enabled.
- Values that could need changing when copying to other device (except that configuration for client and server can be different), like per-app proxy settings in Android client.
Problems:
- Should client enable the extension that's been configured when importing?
- Should client export the extension configuration even if it's not enabled?
Final version:
SIP002 purposed a new URL schema, following RFC3986:
SS-URI = "ss://" userinfo "@" hostname ":" port [ "/" ] [ "?" query ] [ "#" fragment ]
userinfo = websafe-base64-encode-utf8(method ":" password)
The last /
should be appended if query or fragment is present. Example: ss://YmYtY2ZiOnRlc3Q@192.168.100.1:8888/?plugin=url-encoded-plugin-argument-value&unsupported-arguments=should-be-ignored#Dummy+profile+name
. This kind of URIs can be parsed by standard libraries provided by most languages.
For plugin argument, we use the similar format as TOR_PT_SERVER_TRANSPORT_OPTIONS
, which have the format like simple-obfs;obfs=http;obfs-host=www.baidu.com
where colons, semicolons, equal signs and backslashes MUST be escaped with a backslash.