From 9e1d0d8c5eeee738df377cc7bf10206afb3196a9 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 24 Apr 2016 22:40:43 +0200 Subject: [PATCH] update detour config settings --- proxy/vmess/inbound/config.go | 1 + proxy/vmess/inbound/config_json.go | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/proxy/vmess/inbound/config.go b/proxy/vmess/inbound/config.go index 328e9be65..16835e027 100644 --- a/proxy/vmess/inbound/config.go +++ b/proxy/vmess/inbound/config.go @@ -21,4 +21,5 @@ type Config struct { AllowedUsers []*proto.User Features *FeaturesConfig Defaults *DefaultConfig + DetourConfig *DetourConfig } diff --git a/proxy/vmess/inbound/config_json.go b/proxy/vmess/inbound/config_json.go index f51c26ab7..19ad08bde 100644 --- a/proxy/vmess/inbound/config_json.go +++ b/proxy/vmess/inbound/config_json.go @@ -52,9 +52,10 @@ func (this *DefaultConfig) UnmarshalJSON(data []byte) error { func (this *Config) UnmarshalJSON(data []byte) error { type JsonConfig struct { - Users []*proto.User `json:"clients"` - Features *FeaturesConfig `json:"features"` - Defaults *DefaultConfig `json:"default"` + Users []*proto.User `json:"clients"` + Features *FeaturesConfig `json:"features"` + Defaults *DefaultConfig `json:"default"` + DetourConfig *DetourConfig `json:"detour"` } jsonConfig := new(JsonConfig) if err := json.Unmarshal(data, jsonConfig); err != nil { @@ -69,6 +70,9 @@ func (this *Config) UnmarshalJSON(data []byte) error { AlterIDs: 32, } } + if this.Features != nil && this.DetourConfig == nil { + this.DetourConfig = this.Features.Detour + } return nil }