mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update trojan
This commit is contained in:
parent
2a237abade
commit
2782bd1a2c
@ -34,7 +34,18 @@ class QuantumultX
|
|||||||
public static function buildTrojan($password, $server)
|
public static function buildTrojan($password, $server)
|
||||||
{
|
{
|
||||||
$tlsVerification = $server->allow_insecure ? true : false;
|
$tlsVerification = $server->allow_insecure ? true : false;
|
||||||
$uri = "trojan={$server->host}:{$server->port}, password={$password}, over-tls=true, tls-host={$server->server_name}, tls-verification={$tlsVerification}, fast-open=false, udp-relay=false, tag={$server->name}";
|
$config = [
|
||||||
|
"trojan={$server->host}:{$server->port}",
|
||||||
|
"password={$password}",
|
||||||
|
"over-tls=true",
|
||||||
|
$server->server_name ? "tls-host={$server->server_name}" : "",
|
||||||
|
"tls-verification={$tlsVerification}",
|
||||||
|
"fast-open=false",
|
||||||
|
"udp-relay=false",
|
||||||
|
"tag={$server->name}"
|
||||||
|
];
|
||||||
|
$config = array_filter($config);
|
||||||
|
$uri = implode($config, ',');
|
||||||
$uri .= "\r\n";
|
$uri .= "\r\n";
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,17 @@ class Surge
|
|||||||
|
|
||||||
public static function buildTrojan($password, $server)
|
public static function buildTrojan($password, $server)
|
||||||
{
|
{
|
||||||
$uri = "{$server->name} = trojan, {$server->host}, {$server->port}, password={$password}";
|
$allowInsecure = $server->allow_insecure ? true : false;
|
||||||
|
$config = [
|
||||||
|
"{$server->name}=trojan",
|
||||||
|
"{$server->host}",
|
||||||
|
"{$server->port}",
|
||||||
|
"password={$password}",
|
||||||
|
"skip-cert-verify={$allowInsecure}",
|
||||||
|
$server->server_name ? "sni={$server->server_name}" : ""
|
||||||
|
];
|
||||||
|
$config = array_filter($config);
|
||||||
|
$uri = implode($config, ',');
|
||||||
$uri .= "\r\n";
|
$uri .= "\r\n";
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user