1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-18 10:26:01 -05:00
v2fly/app/proxyman/proxyman.go

22 lines
666 B
Go
Raw Normal View History

2018-03-19 04:40:47 -04:00
// Package proxyman defines applications for managing inbound and outbound proxies.
2016-01-31 11:01:28 -05:00
package proxyman
import (
2017-01-14 18:48:37 -05:00
"context"
2019-02-22 18:27:21 -05:00
"v2ray.com/core/common/session"
)
2019-02-22 18:27:21 -05:00
// ContextWithSniffingConfig is a wrapper of session.ContextWithContent.
// Deprecated. Use session.ContextWithContent directly.
2018-07-16 07:47:00 -04:00
func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context {
2019-02-22 18:27:21 -05:00
content := session.ContentFromContext(ctx)
if content == nil {
content = new(session.Content)
ctx = session.ContextWithContent(ctx, content)
}
2019-02-22 18:27:21 -05:00
content.SniffingRequest.Enabled = c.Enabled
content.SniffingRequest.OverrideDestinationForProtocol = c.DestinationOverride
return ctx
}