1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-27 22:36:12 -04:00

remove config from outbound.Handler

This commit is contained in:
Darien Raymond 2018-10-22 08:26:03 +02:00
parent c29f1c8cf0
commit ab9ae703fc
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -16,8 +16,9 @@ import (
"v2ray.com/core/transport/pipe"
)
// Handler is an implements of outbound.Handler.
type Handler struct {
config *core.OutboundHandlerConfig
tag string
senderSettings *proxyman.SenderConfig
streamSettings *internet.MemoryStreamConfig
proxy proxy.Outbound
@ -25,10 +26,11 @@ type Handler struct {
mux *mux.ClientManager
}
// NewHandler create a new Handler based on the given configuration.
func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbound.Handler, error) {
v := core.MustFromContext(ctx)
h := &Handler{
config: config,
tag: config.Tag,
outboundManager: v.GetFeature(outbound.ManagerType()).(outbound.Manager),
}
@ -79,7 +81,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
// Tag implements outbound.Handler.
func (h *Handler) Tag() string {
return h.config.Tag
return h.tag
}
// Dispatch implements proxy.Outbound.Dispatch.