https://github.com/udhos/forward
forward forwards requests to other services.
https://github.com/udhos/forward
forward go golang kubernetes proxy
Last synced: 2 months ago
JSON representation
forward forwards requests to other services.
- Host: GitHub
- URL: https://github.com/udhos/forward
- Owner: udhos
- License: mit
- Created: 2023-05-19T16:45:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-08T04:55:09.000Z (about 3 years ago)
- Last Synced: 2025-12-27T17:09:21.569Z (6 months ago)
- Topics: forward, go, golang, kubernetes, proxy
- Language: Go
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/udhos/forward/blob/main/LICENSE)
[](https://goreportcard.com/report/github.com/udhos/forward)
[](https://pkg.go.dev/github.com/udhos/forward)
[](https://artifacthub.io/packages/search?repo=forward)
[](https://hub.docker.com/r/udhos/forward)
# forward
[forward](https://github.com/udhos/forward) forwards requests to other services.
* [Build](#build)
* [Usage](#usage)
* [Docker](#docker)
* [Helm chart](#helm-chart)
## Build
```
git clone https://github.com/udhos/forward
cd forward
./build.sh
```
## Usage
Send this request body to `forward`.
```
body: put-actual-body-to-forward-here
method: GET
set_headers:
key1: value1
key2: value2
url: http://localhost:2000/v1/hello # put full request URL here
```
### Example for Google
```
# start forward
forward
```
```
# call forward
$ more sample/google.yaml
url: https://www.google.com/search?q=golang
method: GET
$ curl --data-binary @sample/google.yaml localhost:8080/forward
```
### Example for miniapi
Forward to [miniapi](https://github.com/udhos/miniapi).
```
# start miniapi on port 2000
export ADDR=:2000
miniapi
```
```
# start forward
forward
```
```
# call forward
$ more sample/miniapi.yaml
body: aaaaa
method: PUT
set_headers:
a: b
url: http://localhost:2000/v1/hello
$ curl --data-binary @sample/miniapi.yaml localhost:8080/forward
{"request":{"headers":{"A":["b"],"Accept-Encoding":["gzip"],"Content-Length":["5"],"User-Agent":["Go-http-client/1.1"],"X-B3-Sampled":["1"],"X-B3-Spanid":["23e1685fce0c9374"],"X-B3-Traceid":["1c8318e574e71c17b61eec3814ede924"]},"method":"PUT","uri":"/v1/hello","host":"localhost:2000","body":"aaaaa","form_query":{},"form_post":{},"parameters":{"param1":"","param2":""}},"message":"ok","status":200,"server_hostname":"ubuntu","server_version":"1.0.5"}
```
## Docker
Docker hub:
https://hub.docker.com/r/udhos/forward
Pull from docker hub:
```
docker pull udhos/forward:0.0.0
```
Build recipe:
```
./docker/build.sh
```
## Helm chart
### Using the repository
See https://udhos.github.io/forward/.
### Create
```
mkdir charts
cd charts
helm create forward
```
Then edit files.
### Lint
```
helm lint ./charts/forward --values charts/forward/values.yaml
```
### Test rendering chart templates locally
```
helm template forward ./charts/forward --values charts/forward/values.yaml
```
### Render templates at server
```
helm install forward ./charts/forward --values charts/forward/values.yaml --dry-run
```
### Generate files for a chart repository
A chart repository is an HTTP server that houses one or more packaged charts.
A chart repository is an HTTP server that houses an index.yaml file and optionally (*) some packaged charts.
(*) Optionally since the package charts could be hosted elsewhere and referenced by the index.yaml file.
docs
├── index.yaml
└── forward-0.1.0.tgz
See script [update-charts.sh](update-charts.sh):
# generate chart package from source
helm package ./charts/forward -d ./docs
# regenerate the index from existing chart packages
helm repo index ./docs --url https://udhos.github.io/forward/
### Install
```
helm install forward ./charts/forward --values charts/forward/values.yaml
```
### Upgrade
```
helm upgrade forward ./charts/forward --values charts/forward/values.yaml
```
### Uninstall
```
helm uninstall forward
```