github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/app/proxyman/proxyman.go (about)

     1  // Package proxyman defines applications for managing inbound and outbound proxies.
     2  package proxyman
     3  
     4  import (
     5  	"context"
     6  
     7  	"v2ray.com/core/common/session"
     8  )
     9  
    10  // ContextWithSniffingConfig is a wrapper of session.ContextWithContent.
    11  // Deprecated. Use session.ContextWithContent directly.
    12  func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context {
    13  	content := session.ContentFromContext(ctx)
    14  	if content == nil {
    15  		content = new(session.Content)
    16  		ctx = session.ContextWithContent(ctx, content)
    17  	}
    18  	content.SniffingRequest.Enabled = c.Enabled
    19  	content.SniffingRequest.OverrideDestinationForProtocol = c.DestinationOverride
    20  	return ctx
    21  }