1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-27 04:27:20 -05:00
v2fly/app/router/chinaip_json.go
2016-10-12 16:11:13 +02:00

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
}