mirror of
				https://github.com/2dust/v2rayN.git
				synced 2025-10-30 20:12:52 +00:00 
			
		
		
		
	Code clean
This commit is contained in:
		
							parent
							
								
									7eaed21b9a
								
							
						
					
					
						commit
						ea32f75925
					
				
					 1 changed files with 0 additions and 35 deletions
				
			
		|  | @ -113,41 +113,6 @@ namespace v2rayN.Handler.CoreConfig | ||||||
|                     return -1; |                     return -1; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 //overwrite port |  | ||||||
|                 if (node.preSocksPort <= 0) |  | ||||||
|                 { |  | ||||||
|                     var fileContent = File.ReadAllLines(fileName).ToList(); |  | ||||||
|                     var coreType = LazyConfig.Instance.GetCoreType(node, node.configType); |  | ||||||
|                     switch (coreType) |  | ||||||
|                     { |  | ||||||
|                         case ECoreType.v2fly: |  | ||||||
|                         case ECoreType.SagerNet: |  | ||||||
|                         case ECoreType.Xray: |  | ||||||
|                         case ECoreType.v2fly_v5: |  | ||||||
|                             break; |  | ||||||
| 
 |  | ||||||
|                         case ECoreType.clash: |  | ||||||
|                         case ECoreType.clash_meta: |  | ||||||
|                         case ECoreType.mihomo: |  | ||||||
|                             //remove the original |  | ||||||
|                             var indexPort = fileContent.FindIndex(t => t.Contains("port:")); |  | ||||||
|                             if (indexPort >= 0) |  | ||||||
|                             { |  | ||||||
|                                 fileContent.RemoveAt(indexPort); |  | ||||||
|                             } |  | ||||||
|                             indexPort = fileContent.FindIndex(t => t.Contains("socks-port:")); |  | ||||||
|                             if (indexPort >= 0) |  | ||||||
|                             { |  | ||||||
|                                 fileContent.RemoveAt(indexPort); |  | ||||||
|                             } |  | ||||||
| 
 |  | ||||||
|                             fileContent.Add($"port: {LazyConfig.Instance.GetLocalPort(EInboundProtocol.http)}"); |  | ||||||
|                             fileContent.Add($"socks-port: {LazyConfig.Instance.GetLocalPort(EInboundProtocol.socks)}"); |  | ||||||
|                             break; |  | ||||||
|                     } |  | ||||||
|                     File.WriteAllLines(fileName, fileContent); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 msg = string.Format(ResUI.SuccessfulConfiguration, ""); |                 msg = string.Format(ResUI.SuccessfulConfiguration, ""); | ||||||
|             } |             } | ||||||
|             catch (Exception ex) |             catch (Exception ex) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 2dust
						2dust