Skip to content
Ruby client for waithook.com
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
example
lib
tests
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
waithook.gemspec

README.md

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.

You can’t perform that action at this time.