github.com/imannamdari/v2ray-core/v5@v5.0.5/infra/conf/cfgcommon/proxycfg/proxy.go (about)

     1  package proxycfg
     2  
     3  import "github.com/imannamdari/v2ray-core/v5/transport/internet"
     4  
     5  type ProxyConfig struct {
     6  	Tag                 string `json:"tag"`
     7  	TransportLayerProxy bool   `json:"transportLayer"`
     8  }
     9  
    10  //go:generate go run github.com/imannamdari/v2ray-core/v5/common/errors/errorgen
    11  
    12  // Build implements Buildable.
    13  func (v *ProxyConfig) Build() (*internet.ProxyConfig, error) {
    14  	if v.Tag == "" {
    15  		return nil, newError("Proxy tag is not set.")
    16  	}
    17  	return &internet.ProxyConfig{
    18  		Tag:                 v.Tag,
    19  		TransportLayerProxy: v.TransportLayerProxy,
    20  	}, nil
    21  }