Documentation
¶
Index ¶
Constants ¶
View Source
const ( RuleBlock = iota RulePrivate RuleMatchedPass RulePass RuleMatchedProxy RuleProxy RuleIPv6 RuleUnknown )
Variables ¶
View Source
var (
ChinaIP = `` /* 211955-byte string literal not displayed */
)
View Source
var (
// PrivateIP 127.x.x.x is reserved IP, but for simplicity, we put them in private IP block
PrivateIP = `10.0.0.0 10.255.255.255
127.0.0.0/8
172.16.0.0 172.31.255.255
192.168.0.0 192.168.255.255`
)
Functions ¶
func NetIPv4ToInt ¶
NetIPv4ToInt converts net.IP(v4) to its integer representation
Types ¶
type ACL ¶
type ACL struct { Black lookup // Black are those which should be banned, first to check White lookup // White are those which should be accessed directly Gray lookup // Gray are those which should be proxied PrivateIPv4Table []ipRange RemoteDNS bool Legacy bool OmitRules []string }
ACL stands for Access Control List
func LoadACL ¶
LoadACL loads ACL config, which can be chinalist.txt or SS ACL, note that it will always return a valid ACL struct, but may be empty. An empty ACL checks China IP only, if failed, it goes Gray as always.
func (*ACL) IsPrivateIP ¶
IsPrivateIP checks if the given IPv4 is private
Click to show internal directories.
Click to hide internal directories.