mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-30 02:43:01 +00:00
Fix typo
This commit is contained in:
parent
1c3abb2ec3
commit
095b17da62
@ -92,7 +92,7 @@ func find(data, code []byte) []byte {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParaseIPList(ips []string) ([]*GeoIP, error) {
|
func ParseIPList(ips []string) ([]*GeoIP, error) {
|
||||||
var geoipList []*GeoIP
|
var geoipList []*GeoIP
|
||||||
var customCidrs []*CIDR
|
var customCidrs []*CIDR
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParaseIPList(t *testing.T) {
|
func TestParseIPList(t *testing.T) {
|
||||||
t.Log(os.Getenv("xray.location.asset"))
|
t.Log(os.Getenv("xray.location.asset"))
|
||||||
|
|
||||||
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoiptestrouter.dat"), platform.GetAssetLocation("geoip.dat")))
|
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoiptestrouter.dat"), platform.GetAssetLocation("geoip.dat")))
|
||||||
@ -40,7 +40,7 @@ func TestParaseIPList(t *testing.T) {
|
|||||||
"ext-ip:geoiptestrouter.dat:!ca",
|
"ext-ip:geoiptestrouter.dat:!ca",
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := ParaseIPList(ips)
|
_, err := ParseIPList(ips)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to parse geoip list, got %s", err)
|
t.Fatalf("Failed to parse geoip list, got %s", err)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ func (c *NameServerConfig) Build() (*dns.NameServer, error) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
geoipList, err := geoip.ParaseIPList(c.ExpectIPs)
|
geoipList, err := geoip.ParseIPList(c.ExpectIPs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, newError("invalid IP rule: ", c.ExpectIPs).Base(err)
|
return nil, newError("invalid IP rule: ", c.ExpectIPs).Base(err)
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if rawFieldRule.IP != nil {
|
if rawFieldRule.IP != nil {
|
||||||
geoipList, err := geoip.ParaseIPList(*rawFieldRule.IP)
|
geoipList, err := geoip.ParseIPList(*rawFieldRule.IP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if rawFieldRule.SourceIP != nil {
|
if rawFieldRule.SourceIP != nil {
|
||||||
geoipList, err := geoip.ParaseIPList(*rawFieldRule.SourceIP)
|
geoipList, err := geoip.ParseIPList(*rawFieldRule.SourceIP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error) {
|
|||||||
|
|
||||||
var exIP []*geoip.GeoIP
|
var exIP []*geoip.GeoIP
|
||||||
if c.IPsExcluded != nil {
|
if c.IPsExcluded != nil {
|
||||||
exip, err := geoip.ParaseIPList(*c.IPsExcluded)
|
exip, err := geoip.ParseIPList(*c.IPsExcluded)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, newError("failed to parse excluded ip").Base(err)
|
return nil, newError("failed to parse excluded ip").Base(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user