pull/56/head
v2ray 2015-12-05 01:49:03 +01:00
parent 06f9b65ec4
commit 32c3565681
1 changed files with 8 additions and 3 deletions

View File

@ -44,15 +44,20 @@ type Outbound struct {
TargetList []*ConfigTarget `json:"vnext"`
}
func (this *Outbound) UnmarshallJSON(data []byte) error {
err := json.Unmarshal(data, this)
func (this *Outbound) UnmarshalJSON(data []byte) error {
type RawOutbound struct {
TargetList []*ConfigTarget `json:"vnext"`
}
rawOutbound := &RawOutbound{}
err := json.Unmarshal(data, rawOutbound)
if err != nil {
return err
}
if len(this.TargetList) == 0 {
if len(rawOutbound.TargetList) == 0 {
log.Error("0 VMess receiver configured.")
return proxyconfig.BadConfiguration
}
this.TargetList = rawOutbound.TargetList
return nil
}