Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maksim-paskal/developer-proxy
https://github.com/maksim-paskal/developer-proxy
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maksim-paskal/developer-proxy
- Owner: maksim-paskal
- Created: 2024-08-23T12:35:19.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-29T10:14:10.000Z (4 months ago)
- Last Synced: 2024-09-15T08:59:27.199Z (4 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxy local requests to cluster
## MacOS
```bash
brew install maksim-paskal/tap/developer-proxydeveloper-proxy \
-endpoint="https://github.com" \
-rule="/graphql@http://127.0.0.1:4001" \
-rule="equal:/css/main.css@endpoint" \
-rule="regexp:^/(css|scripts)@http://127.0.0.1:4003" \
-rule="prefix:/payment@http://127.0.0.1:4004"
```## Linux
```bash
docker pull paskalmaksim/developer-proxy:latestdocker run --rm -it --net=host paskalmaksim/developer-proxy:latest \
-endpoint="https://github.com" \
-rule="/graphql@http://127.0.0.1:4001" \
-rule="equal:/css/main.css@endpoint" \
-rule="regexp:^/(css|scripts)@http://127.0.0.1:4003" \
-rule="prefix:/payment@http://127.0.0.1:4004"
```proxy will start
## Proxy routing results
```bash
# if no rules match
http://127.0.0.1:10000 => https://github.com# -rule="/graphql@http://127.0.0.1:4001"
http://127.0.0.1:10000/graphql => http://127.0.0.1:4001# -rule="equal:/css/main.css@endpoint"
http://127.0.0.1:10000/css/main.css => https://github.com/css/main.css# -rule="regexp:^/(css|scripts)@http://127.0.0.1:4003"
http://127.0.0.1:10000/css/test.css => http://127.0.0.1:4003/css/test.css# -rule="prefix:/payment@http://127.0.0.1:4004"
http://127.0.0.1:10000/payment/form => http://127.0.0.1:4004/payment/form
```## Local development
```bash
go run ./cmd \
-endpoint="https://github.com" \
-rule="/graphql@http://127.0.0.1:4001" \
-rule="equal:/css/main.css@endpoint" \
-rule="regexp:^/(css|scripts)@http://127.0.0.1:4003" \
-rule="prefix:/payment@http://127.0.0.1:4004"
```