1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-04 02:09:09 -04:00

inbound detour

This commit is contained in:
V2Ray
2015-10-31 22:22:43 +01:00
parent 1708c48f5b
commit 3c43268898
5 changed files with 86 additions and 9 deletions

View File

@@ -21,6 +21,28 @@ type LogConfig struct {
AccessLogValue string
}
type PortRange struct {
FromValue uint16
ToValue uint16
}
func (this *PortRange) From() uint16 {
return this.FromValue
}
func (this *PortRange) To() uint16 {
return this.ToValue
}
type InboundDetourConfig struct {
ConnectionConfig
PortRangeValue *PortRange
}
func (this *InboundDetourConfig) PortRange() config.PortRange {
return this.PortRangeValue
}
func (config *LogConfig) AccessLog() string {
return config.AccessLogValue
}
@@ -30,6 +52,7 @@ type Config struct {
LogConfigValue *LogConfig
InboundConfigValue *ConnectionConfig
OutboundConfigValue *ConnectionConfig
InboundDetoursValue []*InboundDetourConfig
}
func (config *Config) Port() uint16 {
@@ -47,3 +70,11 @@ func (config *Config) InboundConfig() config.ConnectionConfig {
func (config *Config) OutboundConfig() config.ConnectionConfig {
return config.OutboundConfigValue
}
func (this *Config) InboundDetours() []config.InboundDetourConfig {
detours := make([]config.InboundDetourConfig, len(this.InboundDetoursValue))
for idx, detour := range this.InboundDetoursValue {
detours[idx] = detour
}
return detours
}