cloudflare

package
v0.0.0-...-8e88d4a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cloudflare contains Cloudflare-related stuff.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasIP

func HasIP(ip netip.Addr) bool

HasIP checks if ip is in a Cloudflare prefix.

func RealIP

func RealIP(onError func(*http.Request, error)) func(next http.Handler) http.Handler

RealIP returns middleware to update the remote address to the value of CF-Connecting-IP if the request is from a Cloudflare prefix. For this to be secure, the Host header must be verified.

func UpdateIPs

func UpdateIPs(ctx context.Context) error

UpdateIPs updates the Cloudflare IP list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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