Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestinationAddr ¶ added in v1.7.0
DestinationAddr returns the destination server address and port for req, a client HTTP request.
If req.URL.Host contains a port it will be returned, and otherwise the default port according to req.URL.Scheme will be returned. If the included port is not a valid integer, or no port is included and the scheme is unknown, the returned port value will be zero.
func RemoteAddr ¶
RemoteAddr returns the remote (peer) socket address for req, a server HTTP request.
func RequestURL ¶
RequestURL returns a model.URL for req.
If req contains an absolute URI, the values will be split and sanitized, but no further processing performed. For all other requests (i.e. most server-side requests), we reconstruct the URL based on various proxy forwarding headers and other request attributes.
func SchemeDefaultPort ¶ added in v1.7.0
SchemeDefaultPort returns the default port for the given URI scheme, if known, or 0 otherwise.
Types ¶
type ForwardedHeader ¶
ForwardedHeader holds information extracted from a "Forwarded" HTTP header.
func ParseForwarded ¶
func ParseForwarded(f string) ForwardedHeader
ParseForwarded parses a "Forwarded" HTTP header.