Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/draganm/prefixproxy
https://github.com/draganm/prefixproxy
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/draganm/prefixproxy
- Owner: draganm
- Created: 2020-08-01T20:54:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-18T19:42:30.000Z (over 4 years ago)
- Last Synced: 2024-11-06T09:19:56.699Z (about 2 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PrefixProxy
Simplest HTTP proxy that will match requests by path prefix and forward them to the configured backends.
Main reason for writing this proxy is to be used in the situation where both front-end and backend are being developed at the same time.
For example, when front-end is served with Rollup.js, but certain paths have to be served by a Golang backend.## Installation
PrefixProxy is written in Golang. At the moment the only way to get the latest release is to install it using `go get`.
```bash
$ go get -u github.com/draganm/prefixproxy
```## Usage
PrefixProxy is configured using command line arguments.
Each argument has the form `=` where `` is the path matcher and `` is the URL of the backend where the request will be proxied to.By default, PrefixProxy listens on the port `5555`.
This can be changed either by specifying the `--port=xxx` argument, or by setting the `PORT` environment variable.```bash
$ prefixproxy --port=8000 /=http://localhost:5000 /api/=http://localhost:5100
```