Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyledayton/requesthub
Receive, Log, and Proxy HTTP requests
https://github.com/kyledayton/requesthub
Last synced: 15 days ago
JSON representation
Receive, Log, and Proxy HTTP requests
- Host: GitHub
- URL: https://github.com/kyledayton/requesthub
- Owner: kyledayton
- License: mit
- Created: 2015-02-12T18:48:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T23:31:40.000Z (over 8 years ago)
- Last Synced: 2024-08-01T16:18:05.069Z (3 months ago)
- Language: Go
- Homepage:
- Size: 346 KB
- Stars: 235
- Watchers: 20
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# RequestHub
Receive HTTP requests, display them in your browser, and forward them to other URLs.RequestHub is an open source project inspired by [RequestBin](http://requestb.in)
![RequestHub](http://i.imgur.com/pSflmfL.png)
## Overview
I originally developed this to help test and debug webhook systems, but it later found use in our organization to maximize our limited pool of public IPs. We map all of our external service webhooks to one IP, and forward them to internal testing servers. I thought others would have a use for something like this, so I decided to release it as open source software.## Installation
###### Install
```bash
$ go get github.com/kyledayton/requesthub/...
```###### Run
```bash
$ export PATH=$PATH:$GOPATH/bin
$ requesthub
```This will start the server on port 54321.
There are also a few command line options available:
```bash
$ requesthub -h
Usage of requesthub:
-config="": YAML Configuration File
-noweb=false: Disable the web UI
-p=54321: which port to bind to
-password="": HTTP Basic Auth Password for accessing hub
-r=256: max requests to store
-username="": HTTP Basic Auth Username for accessing hub
```Note: To Enable Basic Auth, you must specify both username and password.
## Usage
Open [http://localhost:54321](http://localhost:54321) in your browser. The index page shows a list of your hubs, and a form for creating a hub. Create a hub and it will redirect you to the hub requests page.To send requests to the hub, send any HTTP request to `http://localhost:54321/`
The hub requests page shows stored requests sent to the hub. There is a clear button, which will delete all stored requests in the hub. In addition, there is a form for setting the forwarding URL of the hub. Setting a URL and clicking 'Update URL' will forward any incoming requests to the hub into the specified URL.
## Configuration
RequestHub can create default hubs on startup. Simply create a YAML file with the appropriate hub names and forwarding urls, and pass it to the config option.**config.yml:**
```yaml
hubs:
test-hub:
forward_url: 'https://www.example.com/webhook'
another-hub:
``````bash
$ requesthub -config config.yml
```#### Reload Config
Changes to the config YAML file can be reloaded on the fly by sending SIGHUP to the requesthub process.