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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user