{"id":23006649,"url":"https://github.com/aaronvb/request_hole","last_synced_at":"2025-06-20T15:40:33.603Z","repository":{"id":38998040,"uuid":"337602384","full_name":"aaronvb/request_hole","owner":"aaronvb","description":"Request Hole is a CLI tool and web UI that creates an endpoint to inspect HTTP requests or WebSocket connections and messages.","archived":false,"fork":false,"pushed_at":"2023-10-30T18:30:04.000Z","size":9742,"stargazers_count":4,"open_issues_count":20,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T23:14:07.548Z","etag":null,"topics":["cli","endpoint","go","golang","http","logging","requests","tooling","webhooks","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronvb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-10T03:08:53.000Z","updated_at":"2023-08-02T08:45:48.000Z","dependencies_parsed_at":"2024-06-19T22:51:52.158Z","dependency_job_id":"d73ee6a2-b1a6-45db-8a74-33eab387d1d4","html_url":"https://github.com/aaronvb/request_hole","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronvb%2Frequest_hole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronvb%2Frequest_hole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronvb%2Frequest_hole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronvb%2Frequest_hole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronvb","download_url":"https://codeload.github.com/aaronvb/request_hole/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229795875,"owners_count":18125286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","endpoint","go","golang","http","logging","requests","tooling","webhooks","websocket"],"created_at":"2024-12-15T08:13:13.564Z","updated_at":"2024-12-15T08:13:13.983Z","avatar_url":"https://github.com/aaronvb.png","language":"JavaScript","readme":"# Request Hole CLI\n[![go.dev Reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat)](https://pkg.go.dev/github.com/aaronvb/request_hole)\n[![Go Tests](https://github.com/aaronvb/request_hole/workflows/Test%20Go/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/test_go.yml)\n[![JS Tests](https://github.com/aaronvb/request_hole/workflows/Test%20JS/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/test_js.yml)\n[![Builds](https://github.com/aaronvb/request_hole/workflows/Builds/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/builds.yml)\n\n`rh` is a CLI tool for creating an ephemeral endpoint for testing and inspecting HTTP requests, WebSocket connections, and WebSocket messages from your application or webhook.\n\n\u003cimg width=\"1136\" alt=\"Request Hole CLI web ui\" src=\"https://user-images.githubusercontent.com/100900/125158715-9b866500-e10e-11eb-9438-36d0f8325c60.png\"\u003e\n\n\n## Installation\n### Homebrew\n```\nbrew install aaronvb/request_hole/rh\n```\n\n### Clone repo and build\nFirst make sure you have Go installed: https://golang.org/doc/install\n```\ngit clone git@github.com:aaronvb/request_hole.git\ncd request_hole\ngo build -o $GOBIN/rh\n```\n### Release versions\nDownload the release version for your system: https://github.com/aaronvb/request_hole/releases\n\n## Usage\n```\n$ rh\n```\n\n```\nrh: Request Hole\nThis CLI tool will let you create a temporary API endpoint for testing purposes.\n\nUsage:\n  rh [command]\n\nAvailable Commands:\n  help        Help about any command\n  http        Creates an http endpoint\n  version     Print version number of Request Hole\n  ws          Creates a websocket endpoint\n\nFlags:\n  -a, --address string       sets the address for the endpoint (default \"localhost\")\n      --details              shows header details in the request\n  -h, --help                 help for rh\n      --log string           writes incoming requests to the specified log file (example: --log rh.log)\n  -p, --port int             sets the port for the endpoint (default 8080)\n  -r, --response_code int    sets the response code (default 200)\n      --web                  runs the web UI to show incoming requests\n      --web_address string   sets the address for the web UI (default \"localhost\")\n      --web_port int         sets the port for the web UI (default 8081)\n\nUse \"rh [command] --help\" for more information about a command.\n```\n## Using the Web UI\n### Create an HTTP endpoint\n```\n$ rh http --web\n```\nThis option will open a web UI that will display the incoming requests. Incoming requests will render live in the browser when they are received.\n\n\u003cimg width=\"1136\" alt=\"Request Hole CLI web ui\" src=\"https://user-images.githubusercontent.com/100900/125158715-9b866500-e10e-11eb-9438-36d0f8325c60.png\"\u003e\n\n### Create a WebSocket endpoint\n```\n$ rh ws --web\n```\nThis option will open a web UI that will display the WebSocket connections and incoming messages. Connections and incoming messages will render live in the browser when they are received.\n\n\u003cimg width=\"1375\" alt=\"Screen Shot 2021-11-05 at 15 03 31\" src=\"https://user-images.githubusercontent.com/100900/140592650-fa8aa3d4-41b7-4c2f-9a2b-b81e1bbed575.png\"\u003e\n\n## Using the CLI\n### Creating an HTTP endpoint\nTo create an http endpoint with default settings (port 8080, return status code 200):\n```\n$ rh http\n```\n\u003cimg width=\"785\" alt=\"Request Hole CLI http\" src=\"https://user-images.githubusercontent.com/100900/120266278-474db280-c23d-11eb-9e1f-4d73d18522d5.png\"\u003e\n\n### Creating a WebSocket endpoint\nTo create a WebSocket endpoint with default settings (port 8080):\n```\n$ rh ws\n```\n\u003cimg width=\"784\" alt=\"Request Hole CLI WebSocket\" src=\"https://user-images.githubusercontent.com/100900/140592519-a965af54-a0a3-44cd-be55-1401c8925590.png\"\u003e\n\n### Show header details\nThis option shows all the header details in the incoming request.\n```\n$ rh http --details\n```\n\u003cimg width=\"785\" alt=\"Request Hole CLI details\" src=\"https://user-images.githubusercontent.com/100900/120266674-1d48c000-c23e-11eb-8107-50db997ac3cc.png\"\u003e\n\n### Log to file\nThis option will write the CLI output to the specified log file. Works with other options such as `--details`.\n```\n$ rh http --log rh.log\n```\n\u003cimg width=\"787\" alt=\"Request Hole CLI log\" src=\"https://user-images.githubusercontent.com/100900/120877567-fac2e980-c552-11eb-8ec0-8075bc6c0cd8.png\"\u003e\n\n## Exposing Request Hole to the internet\nSometimes 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](https://ngrok.com).\n```\n$ ngrok http 3001\n$ rh http -p 3001\n```\n\n## Running Tests and Building\nIt is recommended to run the JS build first so that the Go build can embed the latest web UI build.\n\n### CLI\n```\n$ go test -v ./...\n$ go build\n```\n\n### Web UI\n```\n$ cd web; yarn test\n$ cd web; yarn build\n```\n#### For Development\n```\n$ cd web; yarn start\n```\nVisit `localhost:3000`\n\n## Built With\n- Go https://golang.org/\n- logparams https://github.com/aaronvb/logparams\n- logrequest https://github.com/aaronvb/logrequest\n- cobra https://github.com/spf13/cobra\n- gqlgen https://github.com/99designs/gqlgen (GraphQL/Websockets)\n- gorilla/mux https://github.com/gorilla/mux\n- Apollo https://github.com/apollographql/apollo-client (GraphQL frontend)\n- create-react-app https://github.com/facebook/create-react-app\n- Tailwind https://github.com/tailwindlabs/tailwindcss\n- React Testing Library https://github.com/testing-library/react-testing-library\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronvb%2Frequest_hole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronvb%2Frequest_hole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronvb%2Frequest_hole/lists"}