File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -358,13 +358,17 @@ public static string URLSafeBase64Decode(string text)
358
358
data.Type = "SS";
359
359
}
360
360
*/
361
- var parser = new Regex ( @"^(?<server>.+):(?<port>\d+?):(?<protocol>.+?):(?<method>.+?):(?<obfs>.+?):(?<password>.+?)/\?(?<info>.*)$" ) ;
361
+ var parser = new Regex ( @"^(?<server>.+):(?<port>(-? \d+?) ):(?<protocol>.+?):(?<method>.+?):(?<obfs>.+?):(?<password>.+?)/\?(?<info>.*)$" ) ;
362
362
var match = parser . Match ( URLSafeBase64Decode ( text ) ) ;
363
363
364
364
if ( match . Success )
365
365
{
366
366
data . Hostname = match . Groups [ "server" ] . Value ;
367
367
data . Port = int . Parse ( match . Groups [ "port" ] . Value ) ;
368
+ if ( data . Port < 0 )
369
+ {
370
+ data . Port += 65536 ;
371
+ }
368
372
data . Password = URLSafeBase64Decode ( match . Groups [ "password" ] . Value ) ;
369
373
370
374
data . EncryptMethod = match . Groups [ "method" ] . Value ;
You can’t perform that action at this time.
0 commit comments