clientip

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(r *http.Request) (netip.Addr, error)

Get gets the client IP for an http.Request

NOTE: currently only two scenarios are supported: 1. no loadbalancer, local testing 2. behind Google Cloud LoadBalancer (as in cloudrun)

Note that in particular we do not support hitting the CloudRun endpoint directly (though we could easily do so here). Cloud Armor is on the GCLB, so directly accessing the CloudRun endpoint would bypass that.

At this time we have no need to complicate it further.

Types

This section is empty.

Jump to

Keyboard shortcuts

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