Megahook

Forward webhooks to localhost


Project maintained by justinbrumley Hosted on GitHub Pages — Theme by mattgraham

How it works

Megahook’s API receives traffic from your webhook and forwards the request to the client running on your machine. The client will then forward the http request to your local env, get a response back, then send that response back through the API to the original source.

Dependencies

Installing & Running

Using Go

# Installing
go install github.com/justinbrumley/megahook@latest

# Running Local Forward
megahook http://localhost:8080/my/favorite/webhook my-little-webhook

Using Docker

https://hub.docker.com/repository/docker/justinbrumley/megahook

docker run -d \
  -e WEBHOOK_URL=http://localhost:8080/my/favorite/webhook \
  -e WEBHOOK_NAME=my-little-webhook \
  --network host \
  justinbrumley/megahook:latest 

Namespaces

If you would like to use a custom namespace (i.e. subdomain) on megahook, you can register from the CLI using:

megahook register <subdomain>

If successful, this command will return your API token for using the subdomain. Then you can export the api key when using megahook to route webhooks to your custom subdomain:

export MEGAHOOK_API_TOKEN=b85df400e0d5ef78ea0707cc
megahook http://localhost:8080/my/favorite/webhook my-little-webhook 

(this example will forward traffic through https://test-subdomain-1234.api.megahook.in/m/my-little-webhook)