request

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetProxyHeaders

func SetProxyHeaders(r *http.Request)

SetProxyHeaders sets the proxy headers in the request.

func WithInfo

func WithInfo(ctx context.Context, info Info) context.Context

WithInfo adds the Info to the context.

Types

type Info

type Info struct {
	RemoteIP      string // X-Forwarded-For
	RemoteHost    string // X-Forwarded-Host
	RemoteProto   string // X-Forwarded-Proto
	RemotePort    int64  // X-Forwarded-Port
	RemoteHeaders http.Header
}

Info stores request information in the context.

func NewInfo

func NewInfo(r *http.Request) Info

NewInfo creates a new Info instance with the provided values.

Jump to

Keyboard shortcuts

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