Merge pull request #463 from betaxab/fix-vmss-tls

This commit is contained in:
tokumeikoi 2021-07-09 20:24:25 +09:00 committed by GitHub
commit 4d38ce3968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 12 deletions

View File

@ -22,12 +22,12 @@ class Passwall
$uri = '';
foreach ($servers as $item) {
if ($item['type'] === 'shadowsocks') {
$uri .= self::buildShadowsocks($user['uuid'], $item);
}
if ($item['type'] === 'v2ray') {
$uri .= self::buildVmess($user['uuid'], $item);
}
if ($item['type'] === 'shadowsocks') {
$uri .= self::buildShadowsocks($user['uuid'], $item);
}
if ($item['type'] === 'trojan') {
$uri .= self::buildTrojan($user['uuid'], $item);
}
@ -35,7 +35,6 @@ class Passwall
return base64_encode($uri);
}
public static function buildShadowsocks($password, $server)
{
$name = rawurlencode($server['name']);
@ -61,8 +60,14 @@ class Passwall
"host" => "",
"path" => "",
"tls" => $server['tls'] ? "tls" : "",
"sni" => $server['tls'] ? isset(json_decode($server['tlsSettings'], true)['serverName']) : ""
];
if ($server['tls']) {
if ($server['tlsSettings']) {
$tlsSettings = json_decode($server['tlsSettings'], true);
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
$config['sni'] = $tlsSettings['serverName'];
}
}
if ((string)$server['network'] === 'ws') {
$wsSettings = json_decode($server['networkSettings'], true);
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];

View File

@ -22,12 +22,12 @@ class SSRPlus
$uri = '';
foreach ($servers as $item) {
if ($item['type'] === 'shadowsocks') {
$uri .= self::buildShadowsocks($user['uuid'], $item);
}
if ($item['type'] === 'v2ray') {
$uri .= self::buildVmess($user['uuid'], $item);
}
if ($item['type'] === 'shadowsocks') {
$uri .= self::buildShadowsocks($user['uuid'], $item);
}
if ($item['type'] === 'trojan') {
$uri .= self::buildTrojan($user['uuid'], $item);
}
@ -35,7 +35,6 @@ class SSRPlus
return base64_encode($uri);
}
public static function buildShadowsocks($password, $server)
{
$name = rawurlencode($server['name']);
@ -61,8 +60,14 @@ class SSRPlus
"host" => "",
"path" => "",
"tls" => $server['tls'] ? "tls" : "",
"sni" => $server['tls'] ? isset(json_decode($server['tlsSettings'], true)['serverName']) : ""
];
if ($server['tls']) {
if ($server['tlsSettings']) {
$tlsSettings = json_decode($server['tlsSettings'], true);
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
$config['sni'] = $tlsSettings['serverName'];
}
}
if ((string)$server['network'] === 'ws') {
$wsSettings = json_decode($server['networkSettings'], true);
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];

View File

@ -60,8 +60,14 @@ class V2rayN
"host" => "",
"path" => "",
"tls" => $server['tls'] ? "tls" : "",
"sni" => $server['tls'] ? isset(json_decode($server['tlsSettings'], true)['serverName']) : ""
];
if ($server['tls']) {
if ($server['tlsSettings']) {
$tlsSettings = json_decode($server['tlsSettings'], true);
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
$config['sni'] = $tlsSettings['serverName'];
}
}
if ((string)$server['network'] === 'ws') {
$wsSettings = json_decode($server['networkSettings'], true);
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];

View File

@ -60,8 +60,14 @@ class V2rayNG
"host" => "",
"path" => "",
"tls" => $server['tls'] ? "tls" : "",
"sni" => $server['tls'] ? isset(json_decode($server['tlsSettings'], true)['serverName']) : ""
];
if ($server['tls']) {
if ($server['tlsSettings']) {
$tlsSettings = json_decode($server['tlsSettings'], true);
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
$config['sni'] = $tlsSettings['serverName'];
}
}
if ((string)$server['network'] === 'ws') {
$wsSettings = json_decode($server['networkSettings'], true);
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];