chinasites_json.go 398 B

123456789101112131415161718192021
  1. // +build json
  2. package rules
  3. import (
  4. "encoding/json"
  5. "github.com/v2ray/v2ray-core/common/log"
  6. )
  7. func parseChinaSitesRule(data []byte) (*Rule, error) {
  8. rawRule := new(JsonRule)
  9. err := json.Unmarshal(data, rawRule)
  10. if err != nil {
  11. log.Error("Router: Invalid router rule: ", err)
  12. return nil, err
  13. }
  14. return &Rule{
  15. Tag: rawRule.OutboundTag,
  16. Condition: chinaSitesConds,
  17. }, nil
  18. }