浏览代码

tag for default inbound and outbound

Darien Raymond 9 年之前
父节点
当前提交
03d8c33fd1
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      tools/conf/v2ray.go

+ 8 - 0
tools/conf/v2ray.go

@@ -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
 }