- Use Case
- Log in →
- Webhook Forwarding
- Functions (transform)
- WebSocket Server
- Exec Commands
- HTTP Tunnels
- TLS Tunnels
- Global Infrastructure
Internet of Things
- Home Automation
- Internet of Things (IoT)
- CLI commands
- Proxy Configuration
- Self-hosted deployment
- Client configuration
Internet of Things (IoT)
Webhook Relay Socket Server provides an ideal method to communicate with your IoT devices without exposing them to the internet or running an HTTP server on them. It uses a lightweight communication protocol called WebSocket which is available in all major programming languages.
Our WebSockets lets devices to receive webhooks by popular services such as IFTTT, Zapier or anything else. It can also be used for remote access if you are using tunnels. Since webhooks are just a standard HTTP requests, any services can easily produce and consume them. Webhook Relay is particularly useful when:
- Your IoT devices can’t run an HTTP web server to receive webhooks
- You don’t want to run a public MQTT server
- You cannot access your router to configure port forwarding
- Router doesn’t support port forwarding
- Your ISP blocks inbound connections
- You don’t have a static IP address
- Server that is hosting your home automation system is changing IP, location
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
We provide node-red-contrib-webhookrelay node that can be used with Node-RED to easily received webhooks.
To use this node, some configuration is required:
- Create bucket at https://my.webhookrelay.com/buckets
- Generate tokens at https://my.webhookrelay.com/tokens
- Supply bucket and token key & secret into the node
Detailed steps with screenshots are available below.
Open ‘palette’ on your Node-RED web interface and install
Buckets are like groups where you can have multiple input URLs and multiple outputs. Since we are using WebSocket streaming, we don’t really care about the outputs. However, it’s good to create at least one output since then you will be able to resend webhooks manually (good for testing integrations).
Go to your buckets page and create a bucket called
Retrieve token key & secret from https://my.webhookrelay.com/tokens page. While token key will remain visible, secret is already encrypted and cannot be decrypted. If you lose your secret, just delete the token and create a new one.
Add bucket name and your token key & secret into the node:
Any HTTP requests that are received by your Wehbook Relay bucket will be sent to your Node-RED instance:
Message contains several fields:
- topic - bucket name so you can easily use switches if you have multiple buckets streaming at once.
- payload - actual JSON object with all request information:
Webhook Relay allows responding to webhooks via Node-RED from 0.3.0 version. To send responses, ensure that your bucket’s input is configured to return responses (by default for security reasons it will always return 200 status code and an empty body):
- Go to your buckets page https://my.webhookrelay.com/buckets
- Go to the bucket details
- Click on input’s settings
- From the dropdown select “Any output”
Now, to send back responses from the Node-RED back to Webhook Relay so it can respond to the caller, form a payload:
A simple flow that just responds to requests, looks like:
Then, send this payload back to the Webhook Relay node through its input:
$ curl https://my.webhookrelay.com/v1/webhooks/d00e0b31-438f-454f-ab5e-406215aeef84
If you encounter any issues or requests, either submit them here or on the github repository here https://github.com/webhookrelay/node-red-contrib-webhookrelay.