WebHookDistributor

resource

(Daniel Walsh) #1

Hey!

I wanted to share a tool that we created over at FlareBot, this tool allows for you to very easily distribute web-hooks amongst your server without having to expose multiple ports, make multiple subdomains or even have multiple places to update in case of a server move.

This is the usual scenario:
You will have a program listening for a WebHook maybe on port 4456, this will mean on that site your WebHook field is like: 129.168.0.1:4456 and the same goes for other sites but different ports. Or maybe it will be different sub-domains, for example site-1.website.com and site-2.website.com, this means you’d still need to update the backend IPs for whenever they’re updated and obviously allow for them sub-domains to be made like that.

The case with WebHookDistributor:
You setup a single port (which you can just link a sub-domain to) and send all WebHooks over there, instead of the usual updating the IP in multiple places in cases of a server move you just update the DNS. WebHookDistributor works in a very dynamic system, there’s no hard-coding or any of that, if you want to bring up a new listener at any time go for it, if you want to shut one down maybe for an update just do so without fear of losing events! Instead of the WebHooks received just being discarded instead they will be cached so that when your client comes back online it can receive any that it missed!
Instead of site-1.example.com and site-2.example.com it can just be webhooks.example.com/site-1 or webhooks.example.com/site-2 where the webhooks subdomain points to your server port!

I recommend checking the GitHub for more info and some examples, it is still being worked on as we see more need to add things but for right now I think it’s pretty nice.
GitHub link: https://github.com/FlareBot/WebHookDistributor

Example Java Client Class: https://github.com/FlareBot/WebHookDistributor/blob/master/Client/src/main/test/Example.java

The beauty of this service as well is it all works over HTTP so you could create other client implementations in other languages! If anyone does that feel free to make a PR and add it to the README :slight_smile:

Finally, here is a… strangely done diagram showing how it works


(Riley Morycz) #2

:open_mouth: Wow, I know a few developers who will love this! I’ll send it to some, great work Walshy!


(Daniel Walsh) #3

Thank you! This is one of the best projects I’ve made, I loved the idea behind it and I love the way it turned out!


(William Oldham) #4

I would like to take some credit for the idea :eyes: hehe


(Daniel Walsh) #5

Always wanting credit roll eyes :stuck_out_tongue: hehe
Nah big props to you for getting the idea finalised more in my head!


(William Oldham) #6

He he, you’re welcomeee :blush::heart: It turned out wonderful :stuck_out_tongue: