mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
462 B
23 lines
462 B
// Package proxyman defines applications for managing inbound and outbound proxies. |
|
package proxyman |
|
|
|
import ( |
|
"context" |
|
) |
|
|
|
type key int |
|
|
|
const ( |
|
sniffing key = iota |
|
) |
|
|
|
func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context { |
|
return context.WithValue(ctx, sniffing, c) |
|
} |
|
|
|
func SniffingConfigFromContext(ctx context.Context) *SniffingConfig { |
|
if c, ok := ctx.Value(sniffing).(*SniffingConfig); ok { |
|
return c |
|
} |
|
return nil |
|
}
|
|
|