mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 13:17:52 +08:00
subs: add Quantumult X & Surge Shadowsocks support
Signed-off-by: Beta Soft <betaxab@gmail.com>
This commit is contained in:
@ -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 = [
|
||||
|
@ -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';
|
||||
|
Reference in New Issue
Block a user