relay2slack is a tool for capturing and forwarding incoming Slack webhook events.
To install relay2slack, simply:
$ pip install relay2slack
Configuration is retrieved from environment variables – ensure that SLACK_TOKEN
, HTTP_PROXY
, and HTTPS_PROXY
are all set on your system.
To run relay2slack in the foreground:
$ relay2slack
If you would like to daemonize relay2slack, refer to docs/ for supported methods.
For whichever service you would like to product webhook events, instead point it to http://localhost:5000/relay with the normal JSON object you expect to send to Slack. For example:
curl -X POST -d 'payload={"channel":"@blaketmiller","username":"My service","icon_emoji":":warning:","text":"Hello world"}' http://localhost:5000/relay
relay2slack receives that request and forwards the posted JSON object onto the actual Slack webhook endpoint that you provide it in the SLACK_TOKEN
environment variable.