mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-09 11:51:02 -05:00
22 lines
398 B
Go
22 lines
398 B
Go
|
// +build json
|
||
|
|
||
|
package rules
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"github.com/v2ray/v2ray-core/common/log"
|
||
|
)
|
||
|
|
||
|
func parseChinaSitesRule(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 &Rule{
|
||
|
Tag: rawRule.OutboundTag,
|
||
|
Condition: chinaSitesConds,
|
||
|
}, nil
|
||
|
}
|