Sockethook

Proxy webhooks to websockets

  • Reload page when Netlify deploys new version
  • Update contents when a GitHub PR is opened or new commit is made
  • Use command line tools like httpie to put live contents onto a site
Instructions

Choose an arbitrary path, calculate the sha256, write down both.

On your client
Connect to wss://websocket.ericbetts.dev
Subscribe to the sha of the path by sending the following: {"action":"subscribe","key":"<sha of path>"} (Using the SHA to prevent disclosing what the path chosen was)
If you expect messages less than roughtly once every 10 minutes, setup an event to send a message over the connection periodically. Whatever is sent (that doesn't match action: subscribe) is echo'd back.
On your server/producer
POST to https://sockethook.ericbetts.dev/hook/<path you chose>. The body will be sent to all subscribed clients.
Demo
Loading...