• Stars
    star
    171
  • Rank 221,406 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ญ The powerful tool to test webhooks and not only

Logo

WebHook Tester

Release version Project language Build Status Release Status Coverage Image size License

This application allows you to test and debug Webhooks and HTTP requests using unique (random) URLs. You can customize the response code, content-type HTTP header, response content and set some delay for the HTTP responses. The main idea is viewed here.

screencast

This application is written in GoLang and works very fast. It comes with a tiny UI (written in Vue.js), which is built in the binary file, so you don't need any additional assets for the application using. Websockets are also used for incoming webhook notifications in the UI - you don't need any 3rd party solutions (like pusher.com) for this!

๐Ÿ”ฅ Features list

  • Liveness/readiness probes (routes /live and /ready respectively)
  • Can be started without any 3rd party dependencies
  • Metrics in prometheus format (route /metrics)
  • Built-in tiny and fast UI, based on vue.js
  • Multi-arch docker image, based on scratch
  • Unprivileged user in docker image is used
  • Well-tested and documented source code
  • Built-in CLI health check sub-command
  • Recorded request binary view using UI
  • JSON/human-readable logging formats
  • Customizable webhook responses
  • Built-in Websockets support
  • Low memory/cpu usage
  • Free and open-source
  • Ready to scale

๐Ÿ“ท Screenshots

Dashboard Request details Help screen Session options
dash request help new-session

๐Ÿ—ƒ Storage

At the moment 2 types of data storage are supported - memory and redis server (flag --storage-driver).

The memory driver is useful for fast local debugging when recorded requests will not be needed after the app stops. The Redis driver, on the contrary, stores all the data on the redis server, and the data will not be lost after the app restarts. When running multiple app instances (behind the load balancer), it is also necessary to use the redis driver.

๐Ÿ“ข Pub/sub

Publishing/subscribing are used to send notifications using WebSockets, and it also supports 2 types of driver - memory and redis server (flag --pubsub-driver).

For multiple app instances redis driver must be used.

๐Ÿงฉ Installation

Download the latest binary file for your arch (to run on macOS use the linux/arm64 platform) from the releases page. For example, let's install it on amd64 arch (e.g.: Debian, Ubuntu, etc):

$ curl -SsL -o ./webhook-tester https://github.com/tarampampam/webhook-tester/releases/latest/download/webhook-tester-linux-amd64
$ chmod +x ./webhook-tester

# optionally, install the binary file globally:
$ sudo install -g root -o root -t /usr/local/bin -v ./webhook-tester
$ rm ./webhook-tester
$ webhook-tester --help

Additionally, you can use the docker image:

Registry Image
GitHub Container Registry ghcr.io/tarampampam/webhook-tester
Docker Hub tarampampam/webhook-tester

Using the latest tag for the docker image is highly discouraged because of possible backward-incompatible changes during major upgrades. Please, use tags in X.Y.Z format

โš™ Usage

This application supports the following sub-commands:

Sub-command Description
serve Start HTTP server
healthcheck Health checker for the HTTP server (use case - docker healthcheck)

And global flags:

Flag Description
--version, -v Display application version
--verbose Verbose output
--debug Debug output
--log-json Logs in JSON format

๐Ÿ–ฅ HTTP server starting

serve sub-command allows to use next flags:

Flag Description Default value Environment variable
--listen, -l IP address to listen on 0.0.0.0 (all interfaces) LISTEN_ADDR
--port, -p TCP port number 8080 LISTEN_PORT or PORT
--create-session Create a session on server startup with this UUID (example: 00000000-0000-0000-0000-000000000000) CREATE_SESSION
--storage-driver Storage engine (memory or redis) memory STORAGE_DRIVER
--pubsub-driver Pub/Sub engine (memory or redis) memory PUBSUB_DRIVER
--redis-dsn Redis server DSN (required if storage or pub/sub driver is redis) redis://127.0.0.1:6379/0 REDIS_DSN
--ignore-header-prefix Ignore incoming webhook header prefix (case insensitive; example: X-Forwarded-) []
--max-request-body-size Maximal webhook request body size (in bytes; 0 = unlimited) 65536
--max-requests Maximum stored requests per session (max 65535) 128 MAX_REQUESTS
--session-ttl Session lifetime (examples: 48h, 1h30m) 168h SESSION_TTL
--ws-max-clients Maximal websocket clients (0 = unlimited) 0 WS_MAX_CLIENTS
--ws-max-lifetime Maximal single websocket lifetime (examples: 3h, 1h30m; 0 = unlimited) 0 WS_MAX_LIFETIME

Redis DSN format: redis://<user>:<password>@<host>:<port>/<db_number>

Server starting command example:

$ ./webhook-tester --log-json serve \
    --port 8080 \
    --storage-driver redis \
    --pubsub-driver redis \
    --redis-dsn redis://redis-host:6379/0 \
    --max-requests 512 \
    --ignore-header-prefix X-Forwarded- \
    --ignore-header-prefix X-Reverse-Proxy- \
    --create-session 00000000-0000-0000-0000-000000000000 \
    --ws-max-clients 30000 \
    --ws-max-lifetime 6h

After that you can navigate your browser to http://127.0.0.1:8080/ try to send your first HTTP request for the webhook-tester!

๐Ÿ‹ Using docker

Just execute in your terminal:

$ docker run --rm -p 8080:8080/tcp tarampampam/webhook-tester serve

Docker-compose

For running this app using docker-compose and if you want to keep the data after restarts, you can use the following example with a Redis server as a backend for the data:

version: '3.8'

volumes:
  redis-data: {}

services:
  webhook-tester:
    image: tarampampam/webhook-tester
    command: --log-json serve --port 8080 --storage-driver redis --pubsub-driver redis --redis-dsn redis://redis:6379/0
    ports: ['8080:8080/tcp'] # Open <http://127.0.0.1:8080>
    depends_on:
      redis: {condition: service_healthy}

  redis:
    image: redis:7-alpine
    volumes: [redis-data:/data:rw]
    ports: ['6379/tcp']
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']
      interval: 1s

Or you can use in-memory data storage only:

version: '3.8'

services:
  webhook-tester:
    image: tarampampam/webhook-tester
    command: serve --port 8080 --create-session 00000000-0000-0000-0000-000000000000
    ports: ['8080:8080/tcp'] # Open <http://127.0.0.1:8080/#/00000000-0000-0000-0000-000000000000>

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

More Repositories

1

error-pages

๐Ÿšง Pretty server's error pages in the docker image & git repository (for traefik, k8s, nginx and so on)
Go
823
star
2

domains

๐ŸŒ DNS configuration for some of my domains
JavaScript
777
star
3

random-user-agent

๐Ÿ˜Ž Browser extension that automatically replaces the User-Agent with a randomized one
TypeScript
567
star
4

mikrotik-hosts-parser

โœ‚ Mikrotik hosts parser
Go
249
star
5

laravel-roadrunner-in-docker

๐Ÿš€ An example of Laravel app that runs in a docker container with RoadRunner
PHP
176
star
6

3proxy-docker

๐Ÿ“ฒ Docker image with 3proxy - Tiny free proxy server
Dockerfile
120
star
7

nod32-update-mirror

๐Ÿ”ถ [WIP] ESET Nod32 Updates Mirror
Shell
107
star
8

tinifier

๐Ÿผ CLI client for images compressing using tinypng.com API
Go
76
star
9

node-docker

๐Ÿณ Docker image, based on node, with git, bash, and openssh
Dockerfile
51
star
10

indocker-app

๐Ÿ’ฅ Domain names with valid SSL for your local docker containers
Go
33
star
11

curl-docker

๐Ÿฆพ curl (static binary file) in a scratch docker image
Dockerfile
22
star
12

mustpl

๐Ÿงฐ Logic-less CLI templating tool
C
21
star
13

hydra-docker

๐Ÿ™ Dockerized hydra application
Dockerfile
6
star
14

rssbot-docker

๐Ÿค– Docker image with lightweight Telegram RSS notification bot
Dockerfile
5
star
15

colors

๐Ÿฆœ One more Go library for using colors in the terminal console
Go
4
star
16

go-filecache

โšก File-based cache with entries expiration, checksum validation and others
Go
3
star
17

tarampampam

โœจ I found a secret โœจ
HTML
2
star
18

http-proxy-daemon

๐Ÿ’Ž Http Proxy Daemon
Go
2
star
19

arduino-deps-installer

๐ŸŽฏ Arduino sketch dependencies installer
Go
1
star
20

urfave-cli-docs

๐Ÿ“š CLI usage docs generator (markdown)
Go
1
star
21

arduino-elscooter-lighting

๐Ÿ”ฉ My electric scooter lighting firmware
C++
1
star