Skip to content

mauwia/go-webhooker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webhooker

Webhooker is a tool that creates temporary webhook endpoints and forwards incoming HTTP requests to specified destinations. It combines an HTTP server with an SSH server to provide a simple and flexible way to handle webhook traffic, especially useful for local development, testing, and temporary integrations.

Features

  • Create temporary webhook endpoints with unique URLs
  • Forward HTTP requests to any destination with preserved method, headers, and body
  • Support for SSH reverse tunneling to expose local services
  • Simple command-line interface for creating and managing webhooks
  • No registration or account required
  • Path parameters are preserved when forwarding requests

Installation

Prerequisites

  • Go 1.24.0 or higher
  • SSH client

From Source

# Clone the repository
git clone https://github.com/yourusername/webhooker.git
cd webhooker

# Build the application
go build -o webhooker

# Generate SSH host keys (if not present)
mkdir -p keys
ssh-keygen -t rsa -f keys/host_key -N ""

# Run the application
./webhooker

Using Make

# Run directly
make run

Usage

Creating a Webhook

  1. Start the Webhooker server:

    ./webhooker
  2. Connect to the SSH server:

    ssh localhost -p 2222
  3. When prompted, enter the destination URL where you want webhook requests to be forwarded:

    enter webhook destination:
    http://127.0.0.1:3000/payment/webhook
    
  4. Webhooker will generate a unique webhook URL and provide an SSH command for tunneling:

    Generated Webhook: http://localhost:5000/AESUPDBNR
    
    Command to Copy 
    ssh -R 127.0.0.1:58434:127.0.0.1:3000 localhost -p 2222 tunnel
    
  5. Use the generated webhook URL as the endpoint for your webhook provider

Using SSH Tunneling

If your destination service is running locally or is otherwise not accessible to the Webhooker server, use the SSH reverse tunnel command provided:

ssh -R 127.0.0.1:58434:127.0.0.1:3000 localhost -p 2222 tunnel

This creates a tunnel that forwards traffic from the Webhooker server to your local service.

Example Workflow

  1. Start a local service that should receive webhooks (e.g., the included test app):

    cd testapp
    go run main.go
  2. Create a webhook pointing to your local service using Webhooker

  3. Establish the SSH tunnel to connect the webhook to your local service

  4. Send requests to the generated webhook URL to test your service:

    curl -X POST -H "Content-Type: application/json" \
      -d '{"amount": 1000, "message": "Test payment"}' \
      http://localhost:5000/AESUPDBNR

Test Application

The repository includes a simple test application that can receive webhook requests:

cd testapp
go run main.go

The test app listens on port 3000 and handles webhook requests at /payment/webhook. It expects JSON payloads with amount and message fields.

Security Considerations

  • This tool is designed for development and testing purposes
  • The SSH server accepts all public keys by default (for ease of use)
  • Consider implementing stricter authentication for production use
  • Generate new SSH host keys if deploying in a production environment

How It Works

  1. The HTTP server receives requests at the generated webhook URL
  2. Webhooker looks up the destination associated with the unique ID in the URL
  3. The request is forwarded to the destination URL with all headers and body preserved
  4. The response from the destination is returned to the original caller

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published