1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

tag for default inbound and outbound

This commit is contained in:
Darien Raymond 2016-11-17 23:23:46 +01:00
parent ad3f450bce
commit 03d8c33fd1
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -35,6 +35,7 @@ type InboundConnectionConfig struct {
StreamSetting *StreamConfig `json:"streamSettings"`
Settings json.RawMessage `json:"settings"`
AllowPassive bool `json:"allowPassive"`
Tag string `json:"tag"`
}
func (this *InboundConnectionConfig) Build() (*core.InboundConnectionConfig, error) {
@ -67,6 +68,9 @@ func (this *InboundConnectionConfig) Build() (*core.InboundConnectionConfig, err
return nil, err
}
config.Settings = ts
if len(this.Tag) > 0 {
config.Tag = this.Tag
}
return config, nil
}
@ -76,6 +80,7 @@ type OutboundConnectionConfig struct {
StreamSetting *StreamConfig `json:"streamSettings"`
ProxySettings *ProxyConfig `json:"proxySettings"`
Settings json.RawMessage `json:"settings"`
Tag string `json:"tag"`
}
func (this *OutboundConnectionConfig) Build() (*core.OutboundConnectionConfig, error) {
@ -111,6 +116,9 @@ func (this *OutboundConnectionConfig) Build() (*core.OutboundConnectionConfig, e
}
config.ProxySettings = ps
}
if len(this.Tag) > 0 {
config.Tag = this.Tag
}
return config, nil
}