1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-27 22:20:56 -04:00
v2fly/shell/point/config/json/inbound_detour.go

28 lines
741 B
Go
Raw Normal View History

2015-10-31 17:22:43 -04:00
package json
import (
"encoding/json"
2015-11-21 15:43:40 -05:00
v2net "github.com/v2ray/v2ray-core/common/net"
v2netjson "github.com/v2ray/v2ray-core/common/net/json"
2015-10-31 17:22:43 -04:00
proxyconfig "github.com/v2ray/v2ray-core/proxy/common/config"
)
type InboundDetourConfig struct {
2015-11-21 15:43:40 -05:00
ProtocolValue string `json:"protocol"`
PortRangeValue *v2netjson.PortRange `json:"port"`
SettingsValue json.RawMessage `json:"settings"`
2015-10-31 17:22:43 -04:00
}
func (this *InboundDetourConfig) Protocol() string {
return this.ProtocolValue
}
2015-11-21 15:43:40 -05:00
func (this *InboundDetourConfig) PortRange() v2net.PortRange {
2015-10-31 17:22:43 -04:00
return this.PortRangeValue
}
func (this *InboundDetourConfig) Settings() interface{} {
return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeInbound)
}