1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 01:05:35 -05:00

split listening settings from inbound proxies and apply context

This commit is contained in:
Darien Raymond
2017-01-26 20:46:44 +01:00
parent 3bbdf2a065
commit ca721230e1
73 changed files with 2086 additions and 2957 deletions

View File

@@ -1,55 +0,0 @@
package core
import (
"v2ray.com/core/common"
"v2ray.com/core/common/net"
)
func (v *AllocationStrategy) GetConcurrencyValue() uint32 {
if v == nil || v.Concurrency == nil {
return 3
}
return v.Concurrency.Value
}
func (v *AllocationStrategy) GetRefreshValue() uint32 {
if v == nil || v.Refresh == nil {
return 5
}
return v.Refresh.Value
}
func (v *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy {
if v.AllocationStrategy == nil {
return &AllocationStrategy{}
}
return v.AllocationStrategy
}
func (v *InboundConnectionConfig) GetListenOnValue() net.Address {
if v.GetListenOn() == nil {
return net.AnyIP
}
return v.ListenOn.AsAddress()
}
func (v *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
if v.GetSettings() == nil {
return nil, common.ErrBadConfiguration
}
return v.GetSettings().GetInstance()
}
func (v *OutboundConnectionConfig) GetTypedSettings() (interface{}, error) {
if v.GetSettings() == nil {
return nil, common.ErrBadConfiguration
}
return v.GetSettings().GetInstance()
}
func (v *OutboundConnectionConfig) GetSendThroughValue() net.Address {
if v.GetSendThrough() == nil {
return net.AnyIP
}
return v.SendThrough.AsAddress()
}