mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: clash x compatibility
This commit is contained in:
		| @@ -34,6 +34,7 @@ class Clash | ||||
|         } else { | ||||
|             $config = Yaml::parseFile($defaultConfig); | ||||
|         } | ||||
|         $this->patch($config); | ||||
|         $proxy = []; | ||||
|         $proxies = []; | ||||
|  | ||||
| @@ -173,4 +174,11 @@ class Clash | ||||
|     { | ||||
|         return @preg_match($exp, null) !== false; | ||||
|     } | ||||
|  | ||||
|     private function patch(&$config) | ||||
|     { | ||||
|         // fix clash x dns mode | ||||
|         preg_match('#(ClashX)[/ ]([0-9.]*)#', $_SERVER['HTTP_USER_AGENT'], $matches); | ||||
|         if ($matches[2] < '1.96.2') $config['dns']['enhanced-mode'] = 'redir-host'; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user