skipper: github.com/zalando/skipper/net Index | Files

package net

import "github.com/zalando/skipper/net"

Index

Package Files

net.go

func RemoteHost Uses

func RemoteHost(r *http.Request) net.IP

RemoteHost returns the remote address of the client. When the 'X-Forwarded-For' header is set, then it is used instead. This is how most often proxies behave. Wikipedia shows the format https://en.wikipedia.org/wiki/X-Forwarded-For#Format

Example:

X-Forwarded-For: client, proxy1, proxy2

func RemoteHostFromLast Uses

func RemoteHostFromLast(r *http.Request) net.IP

RemoteHostFromLast returns the remote address of the client. When the 'X-Forwarded-For' header is set, then it is used instead. This is known to be true for AWS Application LoadBalancer. AWS docs https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/x-forwarded-headers.html

Example:

X-Forwarded-For: ip-address-1, ip-address-2, client-ip-address

Package net imports 3 packages (graph) and is imported by 10 packages. Updated 2019-06-12. Refresh now. Tools for package owners.