1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-20 14:35:23 +00:00
v2fly/app/router/rules/chinaip_json.go

20 lines
345 B
Go
Raw Normal View History

2016-02-01 21:30:00 +00:00
// +build json
package rules
import (
"encoding/json"
2016-08-20 18:55:45 +00:00
"v2ray.com/core/common/log"
2016-02-01 21:30:00 +00:00
)
func parseChinaIPRule(data []byte) (*Rule, error) {
rawRule := new(JsonRule)
err := json.Unmarshal(data, rawRule)
if err != nil {
log.Error("Router: Invalid router rule: ", err)
return nil, err
}
return NewChinaIPRule(rawRule.OutboundTag), nil
}