1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-29 18:45:23 +00:00
v2fly/app/proxyman/proxyman.go

24 lines
462 B
Go
Raw Normal View History

2018-03-19 08:40:47 +00:00
// Package proxyman defines applications for managing inbound and outbound proxies.
2016-01-31 16:01:28 +00:00
package proxyman
import (
2017-01-14 23:48:37 +00:00
"context"
2016-01-31 16:01:28 +00:00
)
type key int
const (
2018-07-16 11:47:00 +00:00
sniffing key = iota
)
2018-07-16 11:47:00 +00:00
func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context {
return context.WithValue(ctx, sniffing, c)
}
2018-07-16 11:47:00 +00:00
func SniffingConfigFromContext(ctx context.Context) *SniffingConfig {
if c, ok := ctx.Value(sniffing).(*SniffingConfig); ok {
return c
}
return nil
}