Project

waithook

0.0
No commit activity in last 3 years
No release in over 3 years
Waithook gem is client lib for waithook service http://waithook.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.2
 Project Readme

Waithook ruby client

A ruby client Waithook. Wiathook is a service to transmit HTTP requests over websocket connection. It's kinda Pub/Sub system for HTTP notifications, built for recieving webhook notifications behind proxy or when public IP is unknown (such as cloud CI server).

To recieve notifications you should add http://waithook.com/some_random_string as notification URL and start listening websocket messages at wss://waithook.com/some_random_string.

Command line usage

Install:

gem install waithook

Subscribe and print incoming requests:

waithook waithook.com/my_path

Subscribe and forvard to other web server:

waithook waithook.com/my_path --forward http://localhost:3000/notify

Ruby API

Waithook.default_path = 'my-notification-endpoint' # or using ":path" option in Waithook.subscribe 
waithook = Waithook.subscribe(timeout: 60, raise_on_timeout: true) do |webhook|
  webhook.json_body['order_id'] == order_id
end

waithook.send_to("http://localhost:3000/notify")

When it can be used?

  • Testing integration with payment gateway
  • Testing github webhooks
  • Testing incoming email processing
  • Testing slack bots
  • Testing facebook webhooks

Waithook service just help to deliver webhook to your application when public IP is unknown or not available. It can help when multiple developers testing integration with other service on localhost or your automated tests running in CI.