feat: Support shadowrocket to get obfs parameters in shadowsocks.

This commit is contained in:
ishkong 2024-07-21 14:01:03 +08:00 committed by GitHub
parent dd8267097e
commit e46f2b3390
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,11 @@ class Shadowrocket
['-', '_', ''], ['-', '_', ''],
base64_encode("{$server['cipher']}:{$password}") base64_encode("{$server['cipher']}:{$password}")
); );
return "ss://{$str}@{$server['host']}:{$server['port']}#{$name}\r\n"; $uri = "ss://{$str}@{$server['host']}:{$server['port']}";
if ($server['obfs'] == 'http') {
$uri .= "?plugin=obfs-local;obfs=http;obfs-host={$server['obfs-host']};obfs-uri={$server['obfs-path']}";
}
return $uri."#{$name}\r\n";
} }
public static function buildVmess($uuid, $server) public static function buildVmess($uuid, $server)
@ -283,4 +287,4 @@ class Shadowrocket
} }
return $uri; return $uri;
} }
} }