ssr-uri-help
v1.0.1
Published
用于解析和编码ssr的base64加密链接和rss订阅的加密链接
Downloads
4
Readme
使用说明
用于解析和编码ssr的base64加密链接和rss订阅的加密链接
使用方法
导入包
const ssrUriHelp = require('ssr-uri-help')
const Base64 = require('js-base64').Base64
ssr对象编码为ssr链接
console.log(ssrUriHelp.ssrEncode({
server: 'test.ssr.com',
port: 1080,
protocol: 'origin',
method: 'rc4-md5',
obfs: 'plain',
password: '123456',
obfsParam: 'bing.com',
protoParam: '',
remarks: '香港'
}))
ssr链接解码为对象
console.log(ssrUriHelp.ssrDecode('ssr://dGVzdC5zc3IuY29tOjEwODA6b3JpZ2luOnJjNC1tZDU6cGxhaW46TVRJek5EVTIvP29iZnNwYXJhbT1ZbWx1Wnk1amIyMCZyZW1hcmtzPTZhYVo1cml2'))
ssr对象数组编码为订阅链接
console.log(Base64.encode(ssrUriHelp.ssrRssEncode([
{
server: 'test.ssr.com',
port: 1080,
protocol: 'origin',
method: 'rc4-md5',
obfs: 'plain',
password: '123456',
obfsParam: 'bing.com',
protoParam: '',
remarks: '香港'
}
]).join('\n')))
订阅链接解码为对象数组
console.log(ssrUriHelp.ssrRssDecode('c3NyOi8vZEdWemRDNXpjM0l1WTI5dE9qRXdPREE2YjNKcFoybHVPbkpqTkMxdFpEVTZjR3hoYVc0NlRWUkplazVFVlRJdlAyOWlabk53WVhKaGJUMVpiV3gxV25rMWFtSXlNQ1p5WlcxaGNtdHpQVFpoWVZvMWNtbDI='))