Merge pull request #310 from betaxab/p1

Add Quantumult X & Surge Shadowsocks support
This commit is contained in:
tokumeikoi
2020-10-08 12:12:40 +08:00
committed by GitHub
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';