Balancer Module
This module provides objects for managing the network balancer.
HAProxyOptions
Handles options for HAProxy docker instance.
Attributes:
max_connections
int - Maximum per-process number of concurrent connections.timeout_client
int - Maximum inactivity time on the client side.timeout_connect
int - Maximum time to wait for a connection attempt to a server to succeed.timeout_queue
int - Maximum time to wait in the queue for a connection slot to be free.timeout_server
int - Maximum inactivity time on the server side.listen_host_port
int - Frontend port to the proxy.backend_name
str - Name of Backend section.dashboard_bind_port
int - Port to open to reach the HAProxy dashboard.dashboard_refresh_rate
int - Refresh rate of the HAProxy dashboard page.onions
List[Container] - Each onion container that is connected to the whaornet.
Config
Pydantic Configuration.
ports
| def ports() -> List[int]
Ports which will be used to expose on the local network.
Balancer
HAProxy Load Balancer.
Attributes:
haproxy_options
HAProxyOptions - HAProxy options object.container_options
ContainerOptions - Container options for the HA proxy instance.
Config
Pydantic Configuration.
address
| def address() -> str
Return socks5 address to poxy requests through.
dashboard_address
| def dashboard_address() -> str
Return full dashboard address.
proxies
| def proxies() -> Dict[str, str]
Return proxies to mount onto a requests session.
add_mount_point
| def add_mount_point(mount: MountFile) -> None
Mount a volume into the HAProxy container.
Arguments:
mount
MountFile - File to mount between the container and local file system.
display_settings
| def display_settings() -> None
Log config settings to stdout.
OnionBalancer
def OnionBalancer(onions: List[OnionCircuit], show_log: bool = False) -> Balancer
Context manager which yields a started instance of an HAProxy docker container.
Arguments:
onions
List[OnionCircuit] - List of tor containers to load balance requests across.show_log
bool - If True shows the HAProxies logs on start and stop.Yields:
Balancer
- A started instance of a HAProxy docker container.