mirror of
				https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
				synced 2025-10-31 13:41:07 +08:00 
			
		
		
		
	添加从Torjan Uri中获取sni值 (#52)
* 添加从Torjan Uri中获取sni值 感谢 Skyxim <skyxim@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									87deb369fb
								
							
						
					
					
						commit
						a9d8572060
					
				| @ -1376,6 +1376,15 @@ var ProxyUtils = (function () { | ||||
|                 line = line.split("trojan://")[1]; | ||||
|                 const [server, port] = line.split("@")[1].split("?")[0].split(":"); | ||||
|                 const name = decodeURIComponent(line.split("#")[1].trim()); | ||||
|                 let paramArr = line.split("?") | ||||
|                 let sni=null | ||||
|                 if (paramArr.length > 1) { | ||||
|                     paramArr=paramArr[1].split("#")[0].split("&") | ||||
|                     const params = new Map(paramArr.map((item) => { | ||||
|                         return item.split("=") | ||||
|                     })) | ||||
|                     sni = params.get("sni") | ||||
|                 } | ||||
|                  | ||||
|                 return { | ||||
|                     name: name || `[Trojan] ${server}`, // trojan uri may have no server tag!
 | ||||
| @ -1383,6 +1392,7 @@ var ProxyUtils = (function () { | ||||
|                     server, | ||||
|                     port, | ||||
|                     password: line.split("@")[0], | ||||
|                     sni, | ||||
|                     supported, | ||||
|                 }; | ||||
|             }; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Skyxim
						Skyxim