https://github.com/ahmetozer/cors-proxy
Proxy for cors requests. It is controls origins and proxy host. You can set hosts and origins over remote json file.
https://github.com/ahmetozer/cors-proxy
container cors cors-proxy cors-requests docker https-proxy node proxy
Last synced: about 1 month ago
JSON representation
Proxy for cors requests. It is controls origins and proxy host. You can set hosts and origins over remote json file.
- Host: GitHub
- URL: https://github.com/ahmetozer/cors-proxy
- Owner: ahmetozer
- License: mit
- Created: 2020-08-24T20:21:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-06T20:39:15.000Z (almost 6 years ago)
- Last Synced: 2025-08-18T12:23:42.326Z (10 months ago)
- Topics: container, cors, cors-proxy, cors-requests, docker, https-proxy, node, proxy
- Language: JavaScript
- Homepage: https://hub.docker.com/r/ahmetozer/cors-proxy
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cors Proxy
This is basic Proxy server for cors requests.
It has a build in self cert creator.
http and https request supported with custom port option.
You can load settings from remote url.
```bash
docker run -d --rm -e configurl="https://gist.githubusercontent.com/ahmetozer/2d097b672b845115ccf67ddc36437703/raw/42a15aa0cef9b2d505be57fb229da865e6860403/testgist.json" ahmetozer/cors-proxy
```
Default config reload interval is setted to 60.
If no request send to server, interval function is not triggered.
You can change Config reload interval with `loadint` env variable.
```bash
docker run -d --rm -e loadint="10" -e configurl="https://gist.githubusercontent.com/ahmetozer/2d097b672b845115ccf67ddc36437703/raw/42a15aa0cef9b2d505be57fb229da865e6860403/testgist.json" ahmetozer/cors-proxy
```
If you do not set config url, system will be allow all cross origins and request hosts.
```bash
docker run -it --rm ahmetozer/cors-proxy
```
Https server is use port 443 by default. To change define port variable.
```bash
docker run -it --rm -e port="8443" ahmetozer/cors-proxy
```
You can use own ssl certs with this project.
Mount your certs into container.
```bash
docker run -d --rm -e loadint="10" -e configurl="https://gist.githubusercontent.com/ahmetozer/2d097b672b845115ccf67ddc36437703/raw/42a15aa0cef9b2d505be57fb229da865e6860403/testgist.json" \
-v /my/cert/location/cert.crt:/etc/ssl/certs/project.crt \
-v /my/cert/location/cert.key:/etc/ssl/private/project.key \
ahmetozer/cors-proxy
```
## Json configuration
My recommend settings.
```json
{
"origins" : [
"ahmetozer.org",
"apicors.ahmetozer.org"
],
"hosts" : [
"hub.docker.com"
]
}
```
Only control host.
```json
{
"origins" : "",
"hosts" : [
"hub.docker.com"
]
}
```
Only control origin.
```json
{
"origins" : [
"ahmetozer.org",
"apicors.ahmetozer.org"
],
"hosts" : ""
}
```