Trying smee
I recently learned about smee
, which is a tool to forward webhooks (or any other kind of HTTP Post request) to a locally running service. This can come in particularly handy while developing a service locally, which isnβt exposed on your machine.
The idea is simple:
- You create a channel on smee.io. This gives you a public endpoint that can receive HTTP POST requests.
- Smee.io emits incoming requests as Server-Sent Events (SSE).
- A local smee client subscribes to these events and forwards them to your local service.
A simple walk through using a http-bin as locally running service which is not exposed to the internet:
- Install
smee-client
on your local machine
$ npm install -g smee-client
- Run
http-bin
(or any other service)
$ docker run -p 3000:80 kennethreitz/httpbin
- Run
smee-client
$ smee \ # smee client
-t http://localhost:3000/post # locally running service
Forwarding https://smee.io/svEz8ll4Q0B8w36z to http://localhost:3000/post
Connected to https://smee.io/svEz8ll4Q0B8w36z
Note: you can also manually register a new channel by going to https://smee.io/ and clicking “Register New Channel”. Which will… create a new channel. You can use the endpoint of this channel by providing the -u
flag:
$ smee \ # smee client
-u https://smee.io/rCUe9fx5k03oryf7 \ # enter smee URL
-t http://localhost:3000/post # locally running service
Forwarding https://smee.io/rCUe9fx5k03oryf7 to http://localhost:3000/post
Connected to https://smee.io/rCUe9fx5k03oryf7
If you now send your payload to the smee
endpoint, it will be forwarded to you locally running service:
curl -XPOST 'https://smee.io/rCUe9fx5k03oryf7' \
-d '{"hello":"world"}'
Your smee
client should confirm that with a 200 (or any other HTTP code your service yields).
Forwarding https://smee.io/rCUe9fx5k03oryf7 to http://localhost:3000/post
Connected to https://smee.io/rCUe9fx5k03oryf7
POST http://localhost:3000/post - 200
Definitely a good tool to have as part of your tool box.