A pure-python asyncio implementation of an HAProxy Stream Processing Offload Agent (SPOA)
Project description
HAProxy SPOA
A pure Python implementation of an HAProxy Stream Processing Offload Agent with asyncio support.
This library handles the lower level details of the Stream Processing Offload Protocol, allowing quick implementation of custom agents.
See the example
folder for the full example, including an example HAProxy configuration.
from ipaddress import IPv4Address
from haproxyspoa.payloads.ack import AckPayload
from haproxyspoa.spoa_server import SpoaServer
agent = SpoaServer()
@agent.handler("earth-to-mars")
async def handle_earth_to_mars(src: IPv4Address, req_host: str):
return AckPayload().set_txn_var("src_echo", str(src) + req_host)
if __name__ == "__main__":
agent.run(host='127.0.0.1', port=9002)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
haproxyspoa-0.0.1.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for haproxyspoa-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64f4c208c6e4e23f42234dffc69771f3265994ce6e1b7c7788b56319a672ad96 |
|
MD5 | 42bfe39ac1dadaa578564a7935563ac3 |
|
BLAKE2b-256 | f3e7c01247a09062bb6e90fa7d7c3b0861f3743b6e80b5d85efe546481a6fd4c |