mirror of
				https://github.com/v2board/v2board.git
				synced 2025-11-04 11:21:46 +08:00 
			
		
		
		
	Client: Loon: add TCP-HTTP support, set cipher to auto
This commit is contained in:
		@@ -69,7 +69,7 @@ class Loon
 | 
				
			|||||||
            "{$server['name']}=vmess",
 | 
					            "{$server['name']}=vmess",
 | 
				
			||||||
            "{$server['host']}",
 | 
					            "{$server['host']}",
 | 
				
			||||||
            "{$server['port']}",
 | 
					            "{$server['port']}",
 | 
				
			||||||
            'aes-128-gcm',
 | 
					            'auto',
 | 
				
			||||||
            "{$uuid}",
 | 
					            "{$uuid}",
 | 
				
			||||||
            'fast-open=false',
 | 
					            'fast-open=false',
 | 
				
			||||||
            'udp=true',
 | 
					            'udp=true',
 | 
				
			||||||
@@ -78,6 +78,15 @@ class Loon
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if ($server['network'] === 'tcp') {
 | 
					        if ($server['network'] === 'tcp') {
 | 
				
			||||||
            array_push($config, 'transport=tcp');
 | 
					            array_push($config, 'transport=tcp');
 | 
				
			||||||
 | 
					            if ($server['networkSettings']) {
 | 
				
			||||||
 | 
					                $tcpSettings = $server['networkSettings'];
 | 
				
			||||||
 | 
					                if (isset($tcpSettings['header']['type']) && !empty($tcpSettings['header']['type']))
 | 
				
			||||||
 | 
					                    $config = str_replace('transport=tcp', "transport={$tcpSettings['header']['type']}", $config);
 | 
				
			||||||
 | 
					                if (isset($tcpSettings['header']['request']['path'][0]) && !empty($tcpSettings['header']['request']['path'][0]))
 | 
				
			||||||
 | 
					                    array_push($config, "path={$tcpSettings['header']['request']['path'][0]}");
 | 
				
			||||||
 | 
					                if (isset($tcpSettings['header']['Host']) && !empty($tcpSettings['header']['Host']))
 | 
				
			||||||
 | 
					                    array_push($config, "host={$tcpSettings['header']['Host']}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if ($server['tls']) {
 | 
					        if ($server['tls']) {
 | 
				
			||||||
            if ($server['network'] === 'tcp')
 | 
					            if ($server['network'] === 'tcp')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user