forwarded

package
v0.0.0-...-221e53e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package forwarded provides tools to deal with proxy related HTTP Headers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsForwarded

func IsForwarded(header http.Header) bool

IsForwarded returns true if a request contains any x-forwarded header.

func ParseXForwardedFor

func ParseXForwardedFor(header http.Header) iter.Seq2[int, net.IP]

ParseXForwardedFor returns an iterator of all valid IP addresses found in X-Forwarded-For header. It yields IP addresses in reverse order so we can easily find the first mach from the rightmost value.

func ParseXForwardedHost

func ParseXForwardedHost(header http.Header) string

ParseXForwardedHost returns the (trimmed) value of X-Forwarded-Host header.

func ParseXForwardedProto

func ParseXForwardedProto(header http.Header) string

ParseXForwardedProto returns the value of X-Forwarded-Proto header. Possible return values are "http", "https" or an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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