From 3a1c134f849694a9abd44928ae034c0f6a037334 Mon Sep 17 00:00:00 2001 From: v2ray Date: Tue, 8 Dec 2015 00:54:45 +0100 Subject: [PATCH] add tag for inbound detour connection --- shell/point/config.go | 1 + shell/point/json/inbound_detour.go | 5 +++++ shell/point/testing/mocks/config.go | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/shell/point/config.go b/shell/point/config.go index d731f1ea..0a740d5f 100644 --- a/shell/point/config.go +++ b/shell/point/config.go @@ -26,6 +26,7 @@ type DnsConfig interface { type InboundDetourConfig interface { Protocol() string PortRange() v2net.PortRange + Tag() string Settings() interface{} } diff --git a/shell/point/json/inbound_detour.go b/shell/point/json/inbound_detour.go index b9b012ba..ee942c9d 100644 --- a/shell/point/json/inbound_detour.go +++ b/shell/point/json/inbound_detour.go @@ -12,6 +12,7 @@ type InboundDetourConfig struct { ProtocolValue string `json:"protocol"` PortRangeValue *v2netjson.PortRange `json:"port"` SettingsValue json.RawMessage `json:"settings"` + TagValue string `json:"tag"` } func (this *InboundDetourConfig) Protocol() string { @@ -25,3 +26,7 @@ func (this *InboundDetourConfig) PortRange() v2net.PortRange { func (this *InboundDetourConfig) Settings() interface{} { return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeInbound) } + +func (this *InboundDetourConfig) Tag() string { + return this.TagValue +} diff --git a/shell/point/testing/mocks/config.go b/shell/point/testing/mocks/config.go index 4f61c170..eeba6a44 100644 --- a/shell/point/testing/mocks/config.go +++ b/shell/point/testing/mocks/config.go @@ -55,6 +55,11 @@ func (this *PortRange) To() v2net.Port { type InboundDetourConfig struct { *ConnectionConfig PortRangeValue *PortRange + TagValue string +} + +func (this *InboundDetourConfig) Tag() string { + return this.TagValue } func (this *InboundDetourConfig) PortRange() v2net.PortRange {