Attention

This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.

harp.utils.network

class Bind[source]

Bases: object

Bind(host: str, port: int)

__init__(host, port)
Parameters:
Return type:

None

host: str
port: int
get_available_network_port()[source]
wait_for_port(port, host='localhost', timeout=10.0)[source]

Wait until a port starts accepting TCP connections. Args:

port: Port number. host: Host address on which the port should exist. timeout: In seconds. How long to wait before raising errors.

Raises:

TimeoutError: The port isn’t accepting connection after time specified in timeout.

Parameters: