class V2Parser: (source)
Implements interfaces: twisted.protocols.haproxy._interfaces.IProxyParser
PROXY protocol version two header parser.
Version two of the PROXY protocol is a binary format.
| Class Method | parse |
Parse a bytestring as a full PROXY protocol header. |
| Method | __init__ |
Undocumented |
| Method | feed |
Consume a chunk of data and attempt to parse it. |
| Constant | ADDRESSFORMATS |
Undocumented |
| Constant | COMMANDS |
Undocumented |
| Constant | PREFIX |
Undocumented |
| Constant | VERSIONS |
Undocumented |
| Instance Variable | buffer |
Undocumented |
| Static Method | _bytesToIPv4 |
Convert packed 32-bit IPv4 address bytes into a dotted-quad ASCII bytes representation of that address. |
| Static Method | _bytesToIPv6 |
Convert packed 128-bit IPv6 address bytes into a colon-separated ASCII bytes representation of that address. |
| Parameters | |
| line:bytes | A bytestring that represents a valid HAProxy PROXY protocol version 2 header. |
| Returns | |
A _interfaces.IProxyInfo containing the parsed data. | |
| Raises | |
InvalidProxyHeader | If the bytestring does not represent a valid PROXY header. |
| Parameters | |
| data:bytes | A bytestring. |
| Returns | |
A two-tuple containing, in order, a _interfaces.IProxyInfo and any bytes fed to the parser that followed the end of the header. Both of these values are None until a complete header is parsed. | |
| Raises | |
InvalidProxyHeader | If the bytes fed to the parser create an invalid PROXY header. |
Undocumented
| Value |
|