Simple FastAPI webhook server that broadcasts incoming webhook payloads to connected WebSocket clients.
python -m venv .venv
source ./.venv/bin/activate
python -m pip install -r requirements.txtpython -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt# add -vvv for verbose logging
python server.pyThe server runs at http://127.0.0.1:5000.
In one terminal, connect to the WebSocket tunnel:
websocat ws://127.0.0.1:5000/tunnelIn another terminal, send a webhook payload:
curl -X POST http://127.0.0.1:5000/webhook \
-H "Content-Type: application/json" \
-d '{"message":"hello from webhook"}'Invoke-RestMethod -Method Post -Uri http://127.0.0.1:5000/webhook -ContentType "application/json" -Body '{"message":"hello from webhook"}'The connected WebSocket client should receive the JSON payload.