mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-16 09:26:21 -05:00
20 lines
358 B
Go
20 lines
358 B
Go
// +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
|
|
}
|