Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`haproxy`.`_v1parser`.`V1Parser``

class documentation

`class V1Parser: (source)`

Implements interfaces: `twisted.protocols.haproxy._interfaces.IProxyParser`

View In Hierarchy

PROXY protocol version one header parser.

Version one of the PROXY protocol is a human readable format represented by a single, newline delimited binary string that contains all of the relevant source and destination data.

Class Method | `parse` | Parse a bytestring as a full PROXY protocol header line.
Method | `__init__` | Undocumented
Method | `feed` | Consume a chunk of data and attempt to parse it.
Constant | `ALLOWED_NET_PROTOS` | Undocumented
Constant | `NEWLINE` | Undocumented
Constant | `PROXYSTR` | Undocumented
Constant | `TCP4_PROTO` | Undocumented
Constant | `TCP6_PROTO` | Undocumented
Constant | `UNKNOWN_PROTO` | Undocumented
Instance Variable | `buffer` | Undocumented

@classmethod
def parse(cls, line): (source)
from `twisted.protocols.haproxy._interfaces.IProxyParser`

Parse a bytestring as a full PROXY protocol header line.

Parameters
line:bytes | A bytestring that represents a valid HAProxy PROXY protocol header line.
Returns
`_info.ProxyInfo` | A `_interfaces.IProxyInfo` containing the parsed data.
Raises
`InvalidProxyHeader` | If the bytestring does not represent a valid PROXY header.
`InvalidNetworkProtocol` | When no protocol can be parsed or is not one of the allowed values.
`MissingAddressData` | When the protocol is TCP* but the header does not contain a complete set of addresses and ports.

def __init__(self): (source)

Undocumented

def feed(self, data): (source)
from `twisted.protocols.haproxy._interfaces.IProxyParser`

Consume a chunk of data and attempt to parse it.

Parameters
data:`bytes` | A bytestring.
Returns
`Union[Tuple[_info.ProxyInfo, bytes], Tuple[None, None]]` | 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.

ALLOWED_NET_PROTOS = (source)

Undocumented

Value

    (TCP4_PROTO, TCP6_PROTO, UNKNOWN_PROTO)

NEWLINE: `bytes` = (source)

Undocumented

Value

    b'''\r
    '''

PROXYSTR: `bytes` = (source)

Undocumented

Value

    b'PROXY'

TCP4_PROTO: `bytes` = (source)

Undocumented

Value

    b'TCP4'

TCP6_PROTO: `bytes` = (source)

Undocumented

Value

    b'TCP6'

UNKNOWN_PROTO: `bytes` = (source)

Undocumented

Value

    b'UNKNOWN'

buffer: `bytes` = (source)

Undocumented