https://github.com/kaishuu0123/cors-reverse-proxy
Simple reverse proxy for CORS issue.
https://github.com/kaishuu0123/cors-reverse-proxy
access-control-allow-origin cors cors-enabled cors-proxy go golang reverse-proxy
Last synced: 7 months ago
JSON representation
Simple reverse proxy for CORS issue.
- Host: GitHub
- URL: https://github.com/kaishuu0123/cors-reverse-proxy
- Owner: kaishuu0123
- License: mit
- Created: 2020-07-16T09:16:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T09:47:34.000Z (over 2 years ago)
- Last Synced: 2024-06-19T19:41:49.442Z (about 1 year ago)
- Topics: access-control-allow-origin, cors, cors-enabled, cors-proxy, go, golang, reverse-proxy
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CORS Reverse Proxy
[][release_status]
[][releases]
[][docker]
[][report][release_status]: https://github.com/kaishuu0123/cors-reverse-proxy/actions?query=workflow%3Arelease
[releases]: https://github.com/kaishuu0123/cors-reverse-proxy/releases
[docker]: https://hub.docker.com/r/kaishuu0123/cors-reverse-proxy/
[report]: https://goreportcard.com/report/github.com/kaishuu0123/cors-reverse-proxySimple reverse proxy for CORS issue.
```plain
... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
```## Use Case
* Local development
* When you want to trust the resources of a other container
* ex. minio, draw.io, piwigo etc ...## Usage
```shell
docker pull kaishuu0123/cors-reverse-proxydocker run -it -d \
-e CORS_REVERSE_PROXY_TARGET_URL=http://example.com \
-e CORS_REVERSE_PROXY_HOST=0.0.0.0 \
-p 8181:8081 \
--name cors-reverse-proxy \
kaishuu0123/cors-reverse-proxy
```or
```shell
go build./cors-reverse-proxy \
--target-url http://example.com/ \
--host 0.0.0.0
--port 8888
```## Command Line Options & Environment Variables
| CLI Option(Long) | Shorthand | Environment Variables | Example | Default |
| ---------------- | --------- | ----------------------------- | --------------------- | --------- |
| --target-url | -t | CORS_REVERSE_PROXY_TARGET_URL | `http://example.com/` | |
| --host | -h | CORS_REVERSE_PROXY_HOST | `0.0.0.0` | localhost |
| --port | -p | CORS_REVERSE_PROXY_PORT | `8888` | 8081 |
| --origin | -o | CORS_REVERSE_PROXY_ORIGIN | `http://example.com/` | `*` |###### Inspired by: https://github.com/LordotU/local-cors-proxy-go/