Code Monkey home page Code Monkey logo

cors-proxy's Introduction

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.

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.

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.

docker run -it --rm ahmetozer/cors-proxy

Https server is use port 443 by default. To change define port variable.

docker run -it --rm -e port="8443" ahmetozer/cors-proxy

You can use own ssl certs with this project. Mount your certs into container.

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.

{
    "origins" : [
        "ahmetozer.org",
        "apicors.ahmetozer.org"
    ],

    "hosts" : [
        "hub.docker.com"
    ]
}

Only control host.

{
    "origins" : "",

    "hosts" : [
        "hub.docker.com"
    ]
}

Only control origin.

{
    "origins" : [
        "ahmetozer.org",
        "apicors.ahmetozer.org"
    ],

    "hosts" : ""
}

cors-proxy's People

Contributors

ahmetozer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.