mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
358 B
20 lines
358 B
// +build json
|
|
|
|
package rules
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/v2ray/v2ray-core/common/log"
|
|
)
|
|
|
|
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
|
|
}
|