1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-18 16:59:55 -04:00

implement default outbound handler

This commit is contained in:
Darien Raymond
2017-01-15 00:48:37 +01:00
parent b8f01e0c03
commit 34a2ae0ab7
7 changed files with 262 additions and 44 deletions

View File

@@ -1,5 +1,12 @@
package proxyman
import (
"context"
"errors"
"v2ray.com/core/proxy"
)
func (s *AllocationStrategy) GetConcurrencyValue() uint32 {
if s == nil || s.Concurrency == nil {
return 3
@@ -13,3 +20,14 @@ func (s *AllocationStrategy) GetRefreshValue() uint32 {
}
return s.Refresh.Value
}
func (c *OutboundHandlerConfig) GetProxyHandler(ctx context.Context) (proxy.OutboundHandler, error) {
if c == nil {
return nil, errors.New("Proxyman: OutboundHandlerConfig is nil.")
}
config, err := c.ProxySettings.GetInstance()
if err != nil {
return nil, err
}
return proxy.CreateOutboundHandler(ctx, config)
}