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