https://github.com/justinbrumley/megahook
Forward webhooks to your localhost
https://github.com/justinbrumley/megahook
developer-tools development forwarding testing webhooks
Last synced: 6 months ago
JSON representation
Forward webhooks to your localhost
- Host: GitHub
- URL: https://github.com/justinbrumley/megahook
- Owner: justinbrumley
- Created: 2018-03-14T00:21:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T16:17:49.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T05:26:05.075Z (about 2 years ago)
- Topics: developer-tools, development, forwarding, testing, webhooks
- Language: Go
- Homepage: https://megahook.in
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Megahook
### 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
- [Go v1.14](https://golang.org/doc/install)
- or [Docker](https://docs.docker.com/get-docker/)
### Installing & Running
**Using Go**
```bash
# Installing
go get github.com/justinbrumley/megahook
go install github.com/justinbrumley/megahook
# Running Local Forward
megahook http://localhost:8080/my/favorite/webhook my-little-webhook
```
**Using Docker**
[https://hub.docker.com/repository/docker/justinbrumley/megahook](https://hub.docker.com/repository/docker/justinbrumley/megahook)
```bash
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:
```bash
megahook register
```
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:
```bash
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)