mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	Protocols: fix vmess tls sni field
This commit is contained in:
		| @@ -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']; | ||||
|   | ||||
| @@ -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']; | ||||
|   | ||||
| @@ -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']; | ||||
|   | ||||
| @@ -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']; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user