mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	Merge pull request #463 from betaxab/fix-vmss-tls
This commit is contained in:
		| @@ -22,12 +22,12 @@ class Passwall | |||||||
|         $uri = ''; |         $uri = ''; | ||||||
|  |  | ||||||
|         foreach ($servers as $item) { |         foreach ($servers as $item) { | ||||||
|             if ($item['type'] === 'shadowsocks') { |  | ||||||
|                 $uri .= self::buildShadowsocks($user['uuid'], $item); |  | ||||||
|             } |  | ||||||
|             if ($item['type'] === 'v2ray') { |             if ($item['type'] === 'v2ray') { | ||||||
|                 $uri .= self::buildVmess($user['uuid'], $item); |                 $uri .= self::buildVmess($user['uuid'], $item); | ||||||
|             } |             } | ||||||
|  |             if ($item['type'] === 'shadowsocks') { | ||||||
|  |                 $uri .= self::buildShadowsocks($user['uuid'], $item); | ||||||
|  |             } | ||||||
|             if ($item['type'] === 'trojan') { |             if ($item['type'] === 'trojan') { | ||||||
|                 $uri .= self::buildTrojan($user['uuid'], $item); |                 $uri .= self::buildTrojan($user['uuid'], $item); | ||||||
|             } |             } | ||||||
| @@ -35,7 +35,6 @@ class Passwall | |||||||
|         return base64_encode($uri); |         return base64_encode($uri); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public static function buildShadowsocks($password, $server) |     public static function buildShadowsocks($password, $server) | ||||||
|     { |     { | ||||||
|         $name = rawurlencode($server['name']); |         $name = rawurlencode($server['name']); | ||||||
| @@ -61,8 +60,14 @@ class Passwall | |||||||
|             "host" => "", |             "host" => "", | ||||||
|             "path" => "", |             "path" => "", | ||||||
|             "tls" => $server['tls'] ? "tls" : "", |             "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') { |         if ((string)$server['network'] === 'ws') { | ||||||
|             $wsSettings = json_decode($server['networkSettings'], true); |             $wsSettings = json_decode($server['networkSettings'], true); | ||||||
|             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; |             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; | ||||||
|   | |||||||
| @@ -22,12 +22,12 @@ class SSRPlus | |||||||
|         $uri = ''; |         $uri = ''; | ||||||
|  |  | ||||||
|         foreach ($servers as $item) { |         foreach ($servers as $item) { | ||||||
|             if ($item['type'] === 'shadowsocks') { |  | ||||||
|                 $uri .= self::buildShadowsocks($user['uuid'], $item); |  | ||||||
|             } |  | ||||||
|             if ($item['type'] === 'v2ray') { |             if ($item['type'] === 'v2ray') { | ||||||
|                 $uri .= self::buildVmess($user['uuid'], $item); |                 $uri .= self::buildVmess($user['uuid'], $item); | ||||||
|             } |             } | ||||||
|  |             if ($item['type'] === 'shadowsocks') { | ||||||
|  |                 $uri .= self::buildShadowsocks($user['uuid'], $item); | ||||||
|  |             } | ||||||
|             if ($item['type'] === 'trojan') { |             if ($item['type'] === 'trojan') { | ||||||
|                 $uri .= self::buildTrojan($user['uuid'], $item); |                 $uri .= self::buildTrojan($user['uuid'], $item); | ||||||
|             } |             } | ||||||
| @@ -35,7 +35,6 @@ class SSRPlus | |||||||
|         return base64_encode($uri); |         return base64_encode($uri); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public static function buildShadowsocks($password, $server) |     public static function buildShadowsocks($password, $server) | ||||||
|     { |     { | ||||||
|         $name = rawurlencode($server['name']); |         $name = rawurlencode($server['name']); | ||||||
| @@ -61,8 +60,14 @@ class SSRPlus | |||||||
|             "host" => "", |             "host" => "", | ||||||
|             "path" => "", |             "path" => "", | ||||||
|             "tls" => $server['tls'] ? "tls" : "", |             "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') { |         if ((string)$server['network'] === 'ws') { | ||||||
|             $wsSettings = json_decode($server['networkSettings'], true); |             $wsSettings = json_decode($server['networkSettings'], true); | ||||||
|             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; |             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; | ||||||
|   | |||||||
| @@ -60,8 +60,14 @@ class V2rayN | |||||||
|             "host" => "", |             "host" => "", | ||||||
|             "path" => "", |             "path" => "", | ||||||
|             "tls" => $server['tls'] ? "tls" : "", |             "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') { |         if ((string)$server['network'] === 'ws') { | ||||||
|             $wsSettings = json_decode($server['networkSettings'], true); |             $wsSettings = json_decode($server['networkSettings'], true); | ||||||
|             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; |             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; | ||||||
|   | |||||||
| @@ -60,8 +60,14 @@ class V2rayNG | |||||||
|             "host" => "", |             "host" => "", | ||||||
|             "path" => "", |             "path" => "", | ||||||
|             "tls" => $server['tls'] ? "tls" : "", |             "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') { |         if ((string)$server['network'] === 'ws') { | ||||||
|             $wsSettings = json_decode($server['networkSettings'], true); |             $wsSettings = json_decode($server['networkSettings'], true); | ||||||
|             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; |             if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path']; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user