v2ray-core/shell/point/config/json/outbound_detour.go

27 lines
679 B
Go
Raw Normal View History

2015-11-13 22:43:58 +00:00
package json
import (
"encoding/json"
proxyconfig "github.com/v2ray/v2ray-core/proxy/common/config"
2015-11-29 13:45:32 +00:00
"github.com/v2ray/v2ray-core/shell/point/config"
2015-11-13 22:43:58 +00:00
)
type OutboundDetourConfig struct {
ProtocolValue string `json:"protocol"`
TagValue string `json:"tag"`
SettingsValue json.RawMessage `json:"settings"`
}
func (this *OutboundDetourConfig) Protocol() string {
return this.ProtocolValue
}
func (this *OutboundDetourConfig) Tag() config.DetourTag {
return config.DetourTag(this.TagValue)
}
func (this *OutboundDetourConfig) Settings() interface{} {
return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeOutbound)
}