Update README
This commit is contained in:
parent
2e4b06c595
commit
71e2d6b2e6
12
README.md
12
README.md
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
**Capture** is a reverse proxy that takes an incoming HTTP request and sends it to another server,
|
**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
|
proxying the response back to the client, while showing them in a dashboard.
|
||||||
|
|
||||||
[![Build Status](https://github.com/ofabricio/capture/workflows/build/badge.svg)](https://github.com/ofabricio/capture/actions?query=workflow%3Abuild)
|
[![Build Status](https://github.com/ofabricio/capture/workflows/build/badge.svg)](https://github.com/ofabricio/capture/actions?query=workflow%3Abuild)
|
||||||
[![Github Release](https://img.shields.io/github/release/ofabricio/capture.svg)](https://github.com/ofabricio/capture/releases)
|
[![Github Release](https://img.shields.io/github/release/ofabricio/capture.svg)](https://github.com/ofabricio/capture/releases)
|
||||||
|
@ -26,7 +26,7 @@ proxying the response back to the client, while showing them in a dashboard
|
||||||
If you set your base url as `http://example.com/api`, now `http://localhost:9000` points to that
|
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`
|
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
|
*Capture* saves all requests and responses so that you can see them in the dashboard.
|
||||||
|
|
||||||
|
|
||||||
## Dashboard
|
## Dashboard
|
||||||
|
@ -52,9 +52,9 @@ Via docker:
|
||||||
cd capture
|
cd capture
|
||||||
docker run --rm -v $(pwd):/src -w /src -e GOOS=darwin -e GOARCH=amd64 golang:alpine go build -o 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
|
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
|
**Note:** change `GOOS=darwin` to `linux` or `windows` to create an executable for your corresponding Operating System.
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ Plugins must export the following function:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func Handler(proxy http.HandlerFunc) http.HandlerFunc {
|
func Handler(proxy http.HandlerFunc) http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
proxy.ServeHTTP(rw, r)
|
proxy(w, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue