1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-04 09:17:32 -05:00
v2fly/app/proxyman/proxyman.go
2019-02-23 00:27:21 +01:00

22 lines
666 B
Go

// Package proxyman defines applications for managing inbound and outbound proxies.
package proxyman
import (
"context"
"v2ray.com/core/common/session"
)
// ContextWithSniffingConfig is a wrapper of session.ContextWithContent.
// Deprecated. Use session.ContextWithContent directly.
func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context {
content := session.ContentFromContext(ctx)
if content == nil {
content = new(session.Content)
ctx = session.ContextWithContent(ctx, content)
}
content.SniffingRequest.Enabled = c.Enabled
content.SniffingRequest.OverrideDestinationForProtocol = c.DestinationOverride
return ctx
}