middleware

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHijackNotSupported = errors.New("ResponseWriter does not support hijacking")

ErrHijackNotSupported is returned when the ResponseWriter does not support hijacking.

Functions

func GetRealIP

func GetRealIP(req *http.Request) string

GetRealIP extracts the real client IP from the request, checking various headers.

func HijackConnection

func HijackConnection(w http.ResponseWriter, statusCode *int) (net.Conn, *bufio.ReadWriter, error)

HijackConnection hijacks the underlying connection from a ResponseWriter for WebSocket upgrades. It sets statusCode to 101 (Switching Protocols) and returns the hijacked connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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