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`.`_interfaces`.`IProxyParser``

interface documentation

`class IProxyParser(zope.interface.Interface): (source)`

Known implementations: `twisted.protocols.haproxy._v1parser.V1Parser`, `twisted.protocols.haproxy._v2parser.V2Parser`

View In Hierarchy

Streaming parser that handles PROXY protocol headers.

Method | `feed` | Consume a chunk of data and attempt to parse it.
Method | `parse` | Parse a bytestring as a full PROXY protocol header line.

def feed(data: `bytes`) -> `Union[Tuple[IProxyInfo, bytes], Tuple[None, None]]`: (source)

Consume a chunk of data and attempt to parse it.

Parameters
data:bytes | A bytestring.
Returns
`Union[Tuple[IProxyInfo, bytes], Tuple[None, None]]` | A two-tuple containing, in order, an `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.

def parse(line: `bytes`) -> `IProxyInfo`: (source)

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
`IProxyInfo` | An `IProxyInfo` containing the parsed data.
Raises
`InvalidProxyHeader` | If the bytestring does not represent a valid PROXY header.