capture/README.md

61 lines
1.6 KiB
Markdown
Raw Normal View History

2017-11-08 00:10:54 +01:00
**Capture** is a reverse proxy that captures the network traffic and shows it in a dashboard
2017-11-08 00:10:54 +01:00
2018-07-23 23:49:59 +02:00
## Binaries / Executables
2017-11-08 00:10:54 +01:00
2018-07-23 23:49:59 +02:00
For ready-to-use executables for *Windows*, *Linux* and *Mac*, see [Releases](https://github.com/ofabricio/capture/releases) page
## Running
2017-11-08 00:10:54 +01:00
2018-07-23 23:49:59 +02:00
./capture -url=https://example.com/
2017-11-08 00:10:54 +01:00
### Configurations
| param | description |
|-----------------|-------------|
| `-url` | **Required.** Set the base url you want to capture |
2017-11-18 12:05:41 +01:00
| `-port` | Set the proxy port. Default: *9000* |
2018-07-26 00:27:38 +02:00
| `-dashboard` | Set the dashboard's name. Default: *dashboard* |
2017-11-18 12:05:41 +01:00
| `-max-captures` | Set the max number of captures to show in the dashboard. Default: *16* |
2017-11-08 00:10:54 +01:00
| `-h` | Show help |
2018-07-23 23:49:59 +02:00
## Building
Manually:
git clone https://github.com/ofabricio/capture.git
cd capture
go get -d ./...
go build -o capture .
Via docker:
git clone https://github.com/ofabricio/capture.git
cd capture
docker build -t capture .
docker run --rm -v "${PWD}:/src" -e "OS=linux" capture
2017-11-08 00:10:54 +01:00
## 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
2017-11-08 00:10:54 +01:00
## Dashboard
To access the dashboard go to `http://localhost:9000/dashboard`
The path `/dashboard/**` is reserved, that means if your api has a path like that it will be ignored
in favor of the dashboard. However, you can change the dashboard's name with `-dashboard`
2018-07-23 23:49:59 +02:00
2017-11-08 00:10:54 +01:00
##### Preview
2018-07-26 00:36:21 +02:00
![dashboard](https://i.imgur.com/NlExLPr.png)