conntrack

package
v0.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HijackTracker

type HijackTracker struct {
	// contains filtered or unexported fields
}

HijackTracker tracks connections that have been hijacked (e.g. WebSocket upgrades). http.Server.Shutdown does not close hijacked connections, so they must be tracked and closed explicitly during graceful shutdown.

Use Middleware as the outermost HTTP middleware to ensure hijacked connections are tracked and automatically deregistered when closed.

func (*HijackTracker) CloseAll

func (t *HijackTracker) CloseAll() int

CloseAll closes all tracked hijacked connections and returns the number of connections that were closed.

func (*HijackTracker) Middleware

func (t *HijackTracker) Middleware(next http.Handler) http.Handler

Middleware returns an HTTP middleware that wraps the ResponseWriter so that hijacked connections are tracked and automatically deregistered from the tracker when closed. This should be the outermost middleware in the chain.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL