1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-07 01:46:33 -05:00
v2fly/app/router/rules/chinasites_json.go

22 lines
385 B
Go
Raw Normal View History

2016-02-01 16:30:00 -05:00
// +build json
package rules
import (
"encoding/json"
2016-08-20 14:55:45 -04:00
"v2ray.com/core/common/log"
2016-02-01 16:30:00 -05:00
)
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
}