mirror of
				https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
				synced 2025-10-31 16:11:05 +08:00 
			
		
		
		
	feat: Hysteria2 URI
This commit is contained in:
		
							parent
							
								
									6d11ea0fcc
								
							
						
					
					
						commit
						0e82a7669d
					
				| @ -222,6 +222,39 @@ export default function URI_Producer() { | ||||
|                     proxy['skip-cert-verify'] ? '&allowInsecure=1' : '' | ||||
|                 }${trojanTransport}#${encodeURIComponent(proxy.name)}`;
 | ||||
|                 break; | ||||
|             case 'hysteria2': | ||||
|                 let hysteria2params = []; | ||||
|                 if (proxy['skip-cert-verify']) { | ||||
|                     hysteria2params.push(`insecure=1`); | ||||
|                 } | ||||
|                 if (proxy.obfs) { | ||||
|                     hysteria2params.push( | ||||
|                         `obfs=${encodeURIComponent(proxy.obfs)}`, | ||||
|                     ); | ||||
|                     if (proxy['obfs-password']) { | ||||
|                         hysteria2params.push( | ||||
|                             `obfs-password=${encodeURIComponent( | ||||
|                                 proxy['obfs-password'], | ||||
|                             )}`,
 | ||||
|                         ); | ||||
|                     } | ||||
|                 } | ||||
|                 if (proxy.sni) { | ||||
|                     hysteria2params.push( | ||||
|                         `sni=${encodeURIComponent(proxy.sni)}`, | ||||
|                     ); | ||||
|                 } | ||||
|                 if (proxy.fingerprint) { | ||||
|                     hysteria2params.push( | ||||
|                         `pinSHA256=${encodeURIComponent(proxy.fingerprint)}`, | ||||
|                     ); | ||||
|                 } | ||||
|                 result = `hysteria2://${proxy.password}@${proxy.server}:${ | ||||
|                     proxy.port | ||||
|                 }?${hysteria2params.join('&')}#${encodeURIComponent( | ||||
|                     proxy.name, | ||||
|                 )}`;
 | ||||
|                 break; | ||||
|         } | ||||
|         return result; | ||||
|     }; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ariesly
						Ariesly