mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-01 17:24:15 -04:00
22 lines
556 B
Go
22 lines
556 B
Go
package proxycfg
|
|
|
|
import "github.com/v2fly/v2ray-core/v4/transport/internet"
|
|
|
|
type ProxyConfig struct {
|
|
Tag string `json:"tag"`
|
|
TransportLayerProxy bool `json:"transportLayer"`
|
|
}
|
|
|
|
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
|
|
|
// Build implements Buildable.
|
|
func (v *ProxyConfig) Build() (*internet.ProxyConfig, error) {
|
|
if v.Tag == "" {
|
|
return nil, newError("Proxy tag is not set.")
|
|
}
|
|
return &internet.ProxyConfig{
|
|
Tag: v.Tag,
|
|
TransportLayerProxy: v.TransportLayerProxy,
|
|
}, nil
|
|
}
|