From 32c35656818000d9a4c2eab92aa64d3b35bdf81a Mon Sep 17 00:00:00 2001 From: v2ray Date: Sat, 5 Dec 2015 01:49:03 +0100 Subject: [PATCH] typo --- proxy/vmess/config/json/outbound.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/proxy/vmess/config/json/outbound.go b/proxy/vmess/config/json/outbound.go index f5aa0f4b..6feae011 100644 --- a/proxy/vmess/config/json/outbound.go +++ b/proxy/vmess/config/json/outbound.go @@ -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 }