https://github.com/romnn/devproxy
tiny command line reverse proxy for local development
https://github.com/romnn/devproxy
Last synced: 6 months ago
JSON representation
tiny command line reverse proxy for local development
- Host: GitHub
- URL: https://github.com/romnn/devproxy
- Owner: romnn
- License: mit
- Created: 2022-10-23T23:08:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-05T21:16:53.000Z (about 3 years ago)
- Last Synced: 2025-01-19T08:43:39.848Z (12 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## devproxy
[](https://github.com/romnn/devproxy/actions)
[](https://github.com/romnn/devproxy)
`devproxy` is a tiny command line reverse proxy for local development
written in Go.
### Installation
```bash
go get -u github.com/romnn/devproxy/cmd/devproxy
go install github.com/romnn/devproxy/cmd/devproxy
```
### Example
Assume you have two services running:
- an API service running at http://localhost:8090
- a frontend service running at http://localhost:8080
When trying to access the API service from the frontend service directly,
you probably run into issues with CORS.
Using `devproxy`, you can start a reverse proxy that proxies
multiple services using rules of the format `/path/prefix@http://service-url`.
```bash
devproxy start --port 5000 /api@http://127.0.0.1:8090 /@http://127.0.0.1:8080
```
In this example, the reverse proxy will proxy both services on port 5000 such that all paths with prefix `/api` will be proxied to the API service
at `http://127.0.0.1:8090` and path without a prefix (prefix `/`) will be
proxied to the frontend service at `/@http://127.0.0.1:8080`.
#### Development
##### Tooling
Before you get started, make sure you have installed the following tools:
$ python3 -m pip install pre-commit bump2version
$ go install golang.org/x/tools/cmd/goimports
$ go install golang.org/x/lint/golint
$ go install github.com/fzipp/gocyclo
Please check that all checks pass:
```bash
pre-commit run --all-files
```