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.
22 lines
396 B
22 lines
396 B
9 years ago
|
// +build json
|
||
|
|
||
8 years ago
|
package router
|
||
9 years ago
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
8 years ago
|
"v2ray.com/core/common/log"
|
||
9 years ago
|
)
|
||
|
|
||
8 years ago
|
func parseChinaSitesRule(data []byte) (*RoutingRule, error) {
|
||
9 years ago
|
rawRule := new(JsonRule)
|
||
|
err := json.Unmarshal(data, rawRule)
|
||
|
if err != nil {
|
||
|
log.Error("Router: Invalid router rule: ", err)
|
||
|
return nil, err
|
||
|
}
|
||
8 years ago
|
return &RoutingRule{
|
||
|
Tag: rawRule.OutboundTag,
|
||
|
Domain: chinaSitesDomains,
|
||
9 years ago
|
}, nil
|
||
|
}
|