A POSIX compatible shell script to decode and parse Shadowsocks(R)/V2Ray subscription link.
curl
orwget
to download a linkbase64
to decode base64 format data
The script accepts either one CLI argument or multiple from pipe. The arguments can be:
http(s)://
protocol subscription link which normally contains multiple configurations- A single
ss://
orssr://
orvmess://
protocol link which is a single configuration - The downloaded content of subscription link (base64 encoded)
ssr-decode [ (http|https)://link | (ss|ssr|vmess)://BASE64 | BASE64 | < input.txt ]
The local_port
and timeout
in the shadowsocks settings can be controlled with environment variables by LOCAL_PORT
and TIMEOUT
, the default is 1080 for local port and 300 for timeout
LOCAL_PORT=1234 TIMEOUT=600 ssr-decode
The script will generate *.json
configuration files for each Shadowsocks(R)/V2Ray setup.
- The ShadowsocksR configuration file will be named
ssr-$group-$remarks.json
withgroup
normally being the service provider,remarks
being the description of this setup. - The Shadowsocks configuration file will be named
ss-$server-$port.json
. - The V2Ray configuration file will be named
v2ray-$ps.json
withps
normally being the description.