Skip to content

Commit

Permalink
Huge code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciogpp committed Mar 9, 2024
1 parent 958917c commit 406845f
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 1,024 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.16
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.22
id: go

- name: Check out code into the Go module directory
Expand Down
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ proxying the response back to the client, while showing them in a dashboard.

## Running

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

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

#### Settings

| param | description |
|--------------|-------------|
| `-url` | **Required.** Set the url you want to proxy |
| `-url` | **Required.** Set the url 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
Expand All @@ -42,31 +42,20 @@ To access the dashboard go to `http://localhost:9001/`

Manually:

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

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
```sh
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
```

Now you have an executable binary in your directory.

**Note:** change `GOOS=darwin` to `linux` or `windows` to create an executable for your corresponding Operating System.

## Plugins

Put [plugin](https://golang.org/pkg/plugin/) files in the current directory.
They are loaded sorted by filename on startup.

Plugins must export the following function:

```go
func Handler(proxy http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
proxy(w, r)
}
}
```
139 changes: 0 additions & 139 deletions capture.go

This file was deleted.

28 changes: 0 additions & 28 deletions config.go

This file was deleted.

Loading

0 comments on commit 406845f

Please sign in to comment.