Go to file
2019-12-24 06:42:44 -03:00
.github/workflows fetch depth 2019-11-13 20:28:23 -03:00
.gitignore add idea to gitignore 2019-03-10 12:04:53 -03:00
capture.go rename struct 2019-11-23 11:00:26 -03:00
config.go update flag description 2019-12-24 06:42:44 -03:00
dashboard.go remove extra slash from paths 2019-12-19 19:20:20 -03:00
go.mod save req and res with basic types only 2019-11-16 13:47:13 -03:00
go.sum save req and res with basic types only 2019-11-16 13:47:13 -03:00
LICENSE add curl button 2018-11-25 13:01:53 -02:00
main.go rename var 2019-12-20 07:55:45 -03:00
main_test.go save req and res with basic types only 2019-11-16 13:47:13 -03:00
README.md update build cmd to create 64bit version 2019-12-20 18:14:15 -03:00

Capture is a reverse proxy that takes an incoming HTTP request and sends it to another server, proxying the response back to the client, while showing them in a dashboard

Build Status Github Release

Running

./capture -url=https://example.com/

Settings

param description
-url Required. Set the url you want to proxy
-port Set the proxy port. Default: 9000
-dashboard Set the dashboard port. Default: 9001
-captures Set how many captures to show in the dashboard. Default: 16

Using

If you set your base url as http://example.com/api, now http://localhost:9000 points to that address. Hence, calling http://localhost:9000/users/1 is like calling http://example.com/api/users/1

Capture saves all requests and responses so that you can see them in the dashboard

Dashboard

To access the dashboard go to http://localhost:9001/

Preview

dashboard

Building

Manually:

git clone --depth 1 https://github.com/ofabricio/capture.git
cd capture
go build -o capture .

Via docker:

git clone --depth 1 https://github.com/ofabricio/capture.git
cd capture
docker run --rm -v $(pwd):/src -w /src -e GOOS=darwin -e GOARCH=amd64 golang:alpine go build -o capture 

Now you have an executable binary in your directory

Note: you can change GOOS=darwin to linux or windows to create an executable for your corresponding Operating System

Plugins

Put plugin files in the current directory. They are loaded sorted by filename on startup.

Plugins must export the following function:

func Handler(proxy http.HandlerFunc) http.HandlerFunc {
    return func(rw http.ResponseWriter, r *http.Request) {
        proxy.ServeHTTP(rw, r)
    }
}