Install
openclaw skills install webhook-receiverReceive external webhooks and callbacks in real time by exposing a local HTTP endpoint via aitun tunnel. Perfect for AI agents that need to handle GitHub webhooks, payment notifications, OAuth callbacks, form submissions, or any third-party HTTP callback.
openclaw skills install webhook-receiverUse this skill when:
Do NOT use this skill when:
pip install aitun
Or verify it is already installed:
which aitun || pip show aitun
Create a simple HTTP server that processes incoming webhook requests. For example, a Python handler:
# webhook_handler.py
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
class WebhookHandler(BaseHTTPRequestHandler):
def do_POST(self):
content_length = int(self.headers['Content-Length'])
body = self.rfile.read(content_length)
try:
data = json.loads(body)
except Exception:
data = body.decode()
print(f"Received webhook at {self.path}")
print(f"Headers: {dict(self.headers)}")
print(f"Body: {data}")
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(json.dumps({"status": "ok"}).encode())
def do_GET(self):
# Useful for verification endpoints
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(json.dumps({"status": "alive"}).encode())
if __name__ == '__main__':
server = HTTPServer(('0.0.0.0', 8080), WebhookHandler)
print("Webhook handler listening on port 8080")
server.serve_forever()
Start the handler:
python3 webhook_handler.py &
HANDLER_PID=$!
sleep 1
Expose the local handler to the internet:
aitun -p 8080 &
AITUN_PID=$!
sleep 3
The output will contain the public URL, e.g.:
https://aitun.cc/abc123Use the tunnel URL as the webhook/callback endpoint with the third-party service:
https://aitun.cc/abc123/webhookhttps://aitun.cc/abc123/callbackhttps://aitun.cc/abc123/notifyhttps://aitun.cc/abc123/ + your pathTell the user:
Your webhook is now live at: https://aitun.cc/abc123
Register this URL as the callback endpoint in your third-party service.
This tunnel is active and will expire in 24 hours.
When a request arrives, your handler will log it. You can then:
When done, stop the servers:
kill $AITUN_PID 2>/dev/null
kill $HANDLER_PID 2>/dev/null
The aitun command (installed via pip install aitun) accepts these flags:
| Flag | Description |
|---|---|
-p PORT | Local service port (default: 8080) |
-k TOKEN | Auth token for registered subdomain (omit for free tunnel) |
--host HOST | Local service address (default: localhost) |
--tcp-ports PORTS | TCP forwarding ports, comma-separated (e.g., 22,3306; requires -k) |
--p2p | Enable P2P direct connection (default: enabled) |
--no-p2p | Disable P2P, force server relay mode |
--daemon | Run as background daemon |
--stop | Stop running daemon |
aitun.cc/abc123), NOT subdomains