This project is a proxy enabling communication between the Flow Judge client and Baseten webhooks for async inference. It streams webhook payloads to the client without the client needing to expose an endpoint to the Internet.
- Webhook Proxy: Acts as a proxy for incoming webhooks from Baseten async.
- HTTP Streaming: Exposes an endpoint for HTTP streaming that the flow-judge Python client can connect to.
-
Clone the repository:
git clone https://github.com/flowaicom/webhook-proxy.git cd webhook-proxy
-
Build the project:
go build -o proxy .
or
make
-
Run the proxy:
./proxy -addr 0.0.0.0:8000
docker pull ghcr.io/flowaicom/webhook-proxy:latest
docker run --name=flowai-proxy -d -p 8000:8000 ghcr.io/flowaicom/webhook-proxy:latest
Proxy can be configured at the startup with the following flags.
Flag | Default value | Description |
---|---|---|
-addr |
0.0.0.0:8000 |
The interface and port which the proxy should listen on. |
-timeout |
120 | Timeout in seconds after which the client connection will be dropped. Webhooks delivered and not sent to clients within this timeframe will also be dropped. |
-metrics-token |
- | Bearer token for accessing /metrics endpoint serving Prometheus metrics. Takes precendence over the environment variable. |
PROXY_METRICS_TOKEN |
- | Alternative way (env variable) of configuring the token setting above. |
-allow-insecure-metrics |
false |
Whether to allow access to /metrics endpoint without authentication. If set to false (default) and token not set with the options above, the program will generate random token and print it to stdout at startup. |
For detailed API description see docs/
directory.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Make your changes and commit (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.