Metadata-Version: 2.1
Name: haproxyspoa
Version: 0.0.1
Summary: A pure-python asyncio implementation of an HAProxy Stream Processing Offload Agent (SPOA)
Home-page: https://github.com/krrg/haproxy-python-spoa
Author: Ken Reese
Author-email: krrgithub@gmail.com
License: Apache 2
Platform: UNKNOWN
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Topic :: System :: Networking
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: AsyncIO
Description-Content-Type: text/markdown

# 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.

```python
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)
```




