@@ -102,6 +102,60 @@ describe('Proxy URI parser coverage', function () {
102102 } ) ;
103103 } ) ;
104104
105+ it ( 'parses SIP002 Base64URL shadowsocks userinfo' , function ( ) {
106+ const proxy = parseOne (
107+ `ss://${ Base64 . encodeURI (
108+ 'aes-128-gcm:aa>' ,
109+ ) } @ss.example.com:8388#SS%20Base64URL`,
110+ ) ;
111+
112+ expectSubset ( proxy , {
113+ type : 'ss' ,
114+ name : 'SS Base64URL' ,
115+ server : 'ss.example.com' ,
116+ port : 8388 ,
117+ cipher : 'aes-128-gcm' ,
118+ password : 'aa>' ,
119+ } ) ;
120+ } ) ;
121+
122+ it ( 'parses SIP002 plain shadowsocks userinfo with percent-encoded credentials' , function ( ) {
123+ const password = 'sec:ret@/plus+' ;
124+ const proxy = parseOne (
125+ `ss://aes-128-gcm:${ encodeURIComponent (
126+ password ,
127+ ) } @ss.example.com:8388#SS%20Plain`,
128+ ) ;
129+
130+ expectSubset ( proxy , {
131+ type : 'ss' ,
132+ name : 'SS Plain' ,
133+ server : 'ss.example.com' ,
134+ port : 8388 ,
135+ cipher : 'aes-128-gcm' ,
136+ password,
137+ } ) ;
138+ } ) ;
139+
140+ it ( 'parses SIP002 AEAD-2022 plain userinfo without Base64URL decoding' , function ( ) {
141+ const password =
142+ 'YctPZ6U7xPPcU+gp3u+0tx/tRizJN9K8y+uKlW2qjlI=' ;
143+ const proxy = parseOne (
144+ `ss://2022-blake3-aes-256-gcm:${ encodeURIComponent (
145+ password ,
146+ ) } @192.168.100.1:8888#SS%202022`,
147+ ) ;
148+
149+ expectSubset ( proxy , {
150+ type : 'ss' ,
151+ name : 'SS 2022' ,
152+ server : '192.168.100.1' ,
153+ port : 8888 ,
154+ cipher : '2022-blake3-aes-256-gcm' ,
155+ password,
156+ } ) ;
157+ } ) ;
158+
105159 it ( 'parses legacy shadowsocks URIs with v2ray-plugin options' , function ( ) {
106160 const legacy = Base64 . encode (
107161 'chacha20-ietf-poly1305:legacy-pass@legacy.example.com:443' ,
0 commit comments