1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/app/proxyman/proxyman.go

24 lines
462 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"
2016-01-31 11:01:28 -05:00
)
type key int
const (
2018-07-16 07:47:00 -04:00
sniffing key = iota
)
2018-07-16 07:47:00 -04:00
func ContextWithSniffingConfig(ctx context.Context, c *SniffingConfig) context.Context {
return context.WithValue(ctx, sniffing, c)
}
2018-07-16 07:47:00 -04:00
func SniffingConfigFromContext(ctx context.Context) *SniffingConfig {
if c, ok := ctx.Value(sniffing).(*SniffingConfig); ok {
return c
}
return nil
}