Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientAddrFromHeaders ¶
ClientAddrFromHeaders returns the IP address, and optionally port, of the client for an HTTP request from one of various headers in order: Forwarded, X-Real-IP, X-Forwarded-For. For the multi-valued Forwarded and X-Forwarded-For headers, the first value in the list is returned. If the port is unknown, it will be zero.
If the client is able to control the headers, they can control the result of this function. The result should therefore not necessarily be trusted to be correct; that depends on the presence and configuration of proxies in front of apm-server.
func SplitAddrPort ¶
SplitAddrPort splits a network address of the form "host", "host:port", "[host]:port" or "[host]:port" into a netip.Addr and port.
If input has no port, 0 will be returned for the port. If input cannot be parsed or it is empty, (invalidip, 0) will be returned.
Types ¶
This section is empty.