Skip to content

Request Hole is a CLI tool and web UI that creates an endpoint to inspect HTTP requests or WebSocket connections and messages.

License

Notifications You must be signed in to change notification settings

aaronvb/request_hole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Request Hole CLI

go.dev Reference Test Builds

rh is a CLI tool for creating an ephemeral endpoint for testing and inspecting requests from your application or webhook.

Request Hole CLI

Installation

Homebrew

brew install aaronvb/request_hole/rh

Clone repo and build

First make sure you have Go installed: https://golang.org/doc/install

git clone [email protected]:aaronvb/request_hole.git
cd request_hole
go build -o $GOBIN/rh

Release versions

Download the release version for your system: https://github.com/aaronvb/request_hole/releases

Usage

$ rh
rh: Request Hole
This CLI tool will let you create a temporary API endpoint for testing purposes.

Usage:
  rh [command]

Available Commands:
  help        Help about any command
  http        Creates an http endpoint
  version     Print version number of Request Hole

Flags:
  -a, --address string      sets the address for the endpoint (default "localhost")
      --details             shows header details in the request
  -h, --help                help for rh
      --log string          writes incoming requests to the specified log file (example: --log rh.log)
  -p, --port int            sets the port for the endpoint (default 8080)
  -r, --response_code int   sets the response code (default 200)

Use "rh [command] --help" for more information about a command.

Creating an HTTP endpoint

To create an http endpoint with default settings (port 8080, return status code 200):

$ rh http

Request Hole CLI http

Show header details

This option shows all the header details in the incoming request.

$ rh http --details

Request Hole CLI details

Log to file

This option will write the CLI output to the specified log file. Works with other options such as --details.

$ rh http --log rh.log

Request Hole CLI log

Exposing Request Hole to the internet

Sometimes we need to expose rh to the internet to test applications or webhooks from outside of our local dev env. The best way to do this is to use a tunneling service such as ngrok.

$ ngrok http 3001
$ rh http -p 3001

About

Request Hole is a CLI tool and web UI that creates an endpoint to inspect HTTP requests or WebSocket connections and messages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published