mirror of https://github.com/v2ray/v2ray-core
23 lines
379 B
Go
23 lines
379 B
Go
![]() |
// +build json
|
||
|
|
||
![]() |
package router
|
||
![]() |
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
|
||
![]() |
"v2ray.com/core/common/log"
|
||
![]() |
)
|
||
|
|
||
![]() |
func parseChinaIPRule(data []byte) (*RoutingRule, error) {
|
||
![]() |
rawRule := new(JsonRule)
|
||
|
err := json.Unmarshal(data, rawRule)
|
||
|
if err != nil {
|
||
|
log.Error("Router: Invalid router rule: ", err)
|
||
|
return nil, err
|
||
|
}
|
||
![]() |
return &RoutingRule{
|
||
|
Tag: rawRule.OutboundTag,
|
||
|
Ip: chinaIPs,
|
||
|
}, nil
|
||
![]() |
}
|