mirror of
				https://github.com/2dust/v2rayN.git
				synced 2025-10-31 12:32:53 +00:00 
			
		
		
		
	Improves geoip rule handling in singbox
This commit is contained in:
		
							parent
							
								
									7a9e3597be
								
							
						
					
					
						commit
						cee5d0ad89
					
				
					 1 changed files with 12 additions and 8 deletions
				
			
		|  | @ -1242,24 +1242,28 @@ public class CoreConfigSingboxService | ||||||
|         { |         { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|         else if (address.StartsWith("geoip:!")) |  | ||||||
|         { |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|         else if (address.Equals("geoip:private")) |         else if (address.Equals("geoip:private")) | ||||||
|         { |         { | ||||||
|             rule.ip_is_private = true; |             rule.ip_is_private = true; | ||||||
|         } |         } | ||||||
|         else if (address.StartsWith("geoip:")) |         else if (address.StartsWith("geoip:")) | ||||||
|         { |         { | ||||||
|             if (rule.geoip is null) |             rule.geoip ??= new(); | ||||||
|             { rule.geoip = new(); } |  | ||||||
|             rule.geoip?.Add(address.Substring(6)); |             rule.geoip?.Add(address.Substring(6)); | ||||||
|         } |         } | ||||||
|  |         else if (address.Equals("geoip:!private")) | ||||||
|  |         { | ||||||
|  |             rule.ip_is_private = false; | ||||||
|  |         } | ||||||
|  |         else if (address.StartsWith("geoip:!")) | ||||||
|  |         { | ||||||
|  |             rule.geoip ??= new(); | ||||||
|  |             rule.geoip?.Add(address.Substring(6)); | ||||||
|  |             rule.invert = true; | ||||||
|  |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|             if (rule.ip_cidr is null) |             rule.ip_cidr ??= new(); | ||||||
|             { rule.ip_cidr = new(); } |  | ||||||
|             rule.ip_cidr?.Add(address); |             rule.ip_cidr?.Add(address); | ||||||
|         } |         } | ||||||
|         return true; |         return true; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 DHR60
						DHR60