subs: add Quantumult X & Surge Shadowsocks support

Signed-off-by: Beta Soft <betaxab@gmail.com>
This commit is contained in:
Beta Soft
2020-10-04 22:55:40 +08:00
parent 87a9f6727b
commit 1acf64db44
3 changed files with 48 additions and 5 deletions

View File

@ -5,6 +5,22 @@ namespace App\Utils;
class QuantumultX
{
public static function buildShadowsocks($password, $server)
{
$config = [
"shadowsocks={$server->host}:{$server->port}",
"method={$server->cipher}",
"password={$password}",
"fast-open=true",
"udp-relay=true",
"tag={$server->name}"
];
$config = array_filter($config);
$uri = implode(',', $config);
$uri .= "\r\n";
return $uri;
}
public static function buildVmess($uuid, $server)
{
$config = [

View File

@ -5,6 +5,23 @@ namespace App\Utils;
class Surge
{
public static function buildShadowsocks($password, $server)
{
$config = [
"{$server->name}=ss",
"{$server->host}",
"{$server->port}",
"encrypt-method={$server->cipher}",
"password={$password}",
"tfo=true",
"udp-relay=true"
];
$config = array_filter($config);
$uri = implode(',', $config);
$uri .= "\r\n";
return $uri;
}
public static function buildVmess($uuid, $server)
{
$proxies = $server->name . ' = vmess, ' . $server->host . ', ' . $server->port . ', username=' . $uuid . ', tfo=true';