Documentation
¶
Overview ¶
Package forwarded implements a RFC 7239 (Forwarded HTTP Extension) parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses elements in the given line. If reverse is true, the elements are parsed in reverse. The error returned is of type *ParseError.
func ParseRequest ¶
ParseRequests parses elements in the Forwarded header in request r. If reverse is true, the elements are parsed in reverse. The error returned is of type *ParseError.
Types ¶
type Element ¶
Element contains information about a proxy.
func Last ¶
Last returns the last element in the given line. The error returned is of type *ParseError.
func LastRequest ¶
LastRequest returns the last element in the Forwarded header in request r. The error returned is of type *ParseError.
type Node ¶
type Node string
A Node identifier is one of the following:
- The client's IP address, with an optional port number.
- A token indicating that the IP address of the client is not known to the proxy server.
- A generated token, allowing for tracing and debugging, while allowing the internal structure or sensitive information to be hidden.
func (Node) AddrPort ¶
AddrPort attempts to parse node n as a IP address and port. Either addr or node port returned may be invalid.
func (Node) IsObfuscated ¶
IsObfuscated returns true if node n is a generated token.
type NodePort ¶
type NodePort string
NodePort represents the port of a node, either a uint16 value or obfuscated.
func (NodePort) IsObfuscated ¶
IsObfuscated returns true if node port np is obfuscated.
type Paramater ¶
type Paramater struct {
Key, Value string
}
Pair represents a key-value pair making up a element parameter.
type ParseError ¶
ParseError is returned if a line cannot be parsed.
func (*ParseError) Error ¶
func (e *ParseError) Error() string