Skip to content

SCE-Development/smee2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smee2

Simple FastAPI webhook server that broadcasts incoming webhook payloads to connected WebSocket clients.

Install

bash

python -m venv .venv

source ./.venv/bin/activate

python -m pip install -r requirements.txt

windows

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Run

# add -vvv for verbose logging
python server.py

The server runs at http://127.0.0.1:5000.

Test

In one terminal, connect to the WebSocket tunnel:

websocat ws://127.0.0.1:5000/tunnel

In another terminal, send a webhook payload:

bash

curl -X POST http://127.0.0.1:5000/webhook \
  -H "Content-Type: application/json" \
  -d '{"message":"hello from webhook"}'

windows, powershell

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.

About

webhook delivery service

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages