Versions in this module Expand all Collapse all v0 v0.20.0 Jul 5, 2026 v0.19.0 May 27, 2026 Changes in this version + func Forward(ctx context.Context, client, upstream net.Conn, peeked []byte, ...) + func LimitWriter(w io.Writer, n int64) io.Writer + func LoadOrCreateCA(dir string) (*x509.Certificate, *ecdsa.PrivateKey, *tls.Certificate, error) + func LogModeString(m LogMode) string + func PeekClientHello(conn net.Conn) (peeked []byte, serverName string, err error) + func RemoveStats(path string) + func SetLogMode(mode LogMode) + func StatsPath() string + func WriteStats(path string, s Stats) error + type Config struct + Domains []string + Intercept []string + Mode Mode + func LoadConfig(dir string) (*Config, error) + type Decider interface + Allowed func(hostname string) bool + type InteractiveDecider struct + func NewInteractiveDecider(base Decider, prompt PromptFunc) *InteractiveDecider + func (d *InteractiveDecider) Allowed(hostname string) bool + type Interceptor interface + Intercept func(ctx context.Context, conn net.Conn, hostname string, peeked []byte) error + ShouldIntercept func(hostname string) bool + type LeafCache struct + CACert *x509.Certificate + CAKey *ecdsa.PrivateKey + func (lc *LeafCache) Get(hostname string) (*tls.Certificate, error) + type LogMode int32 + const LogModeFull + const LogModeMeta + const LogModeOff + func GetLogMode() LogMode + func ParseLogMode(s string) (LogMode, error) + type LoggingInterceptor struct + Dialer func(ctx context.Context, network, address string) (net.Conn, error) + Domains []string + LeafCache *LeafCache + LogDir string + Logger zerolog.Logger + func (li *LoggingInterceptor) Intercept(ctx context.Context, conn net.Conn, hostname string, peeked []byte) error + func (li *LoggingInterceptor) ShouldIntercept(hostname string) bool + type Mode string + const ModeAllow + const ModeBlock + type NetworkEventEmitter interface + Emit func(source, status, host string) + type Policy struct + func BlockAllPolicy() *Policy + func NewPolicy(mode Mode, domains []string) (*Policy, error) + func (p *Policy) Allowed(hostname string) bool + type PromptFunc func(hostname string) (bool, error) + func NewTerminalPrompt(in io.Reader, out io.Writer) PromptFunc + type Server struct + Addr string + Dialer func(ctx context.Context, network, address string) (net.Conn, error) + Emitter NetworkEventEmitter + Interceptor Interceptor + Logger zerolog.Logger + Policy Decider + func (s *Server) ActiveConns() int64 + func (s *Server) ListenAndServe(ctx context.Context) error + type Stats struct + ActiveConns int64 + func ReadStats(path string) Stats + type TrafficLog struct + Body string + BodySize int64 + Direction string + Host string + Method string + Path string + Status int + Timestamp time.Time