Giter VIP home page Giter VIP logo

cors-proxy's Introduction

cors-proxy

Simple yet powerful HTTPS reverse-proxy to enable CORS.

Usage

Once the project or Docker image is deployed to an host, you can perform any HTTP call. For instance if the host IP address is 123.456.789.012 and the port being used is 7979 (default) then a basic GET call would be like:

curl http://123.456.789.012:7979/https://demo.docusign.net/restapi

Deploy to AWS EC2

sudo yum update -y
sudo amazon-linux-extras install docker
sudo yum install docker
sudo service docker start
sudo systemctl enable docker
sudo docker pull dsdevcenter/cors-proxy
sudo docker run -d --name cors-proxy-container -p 7979:7979 -e ORIGIN_ALLOW_LIST=https://example.com dsdevcenter/cors-proxy

Deploy to Azure

docker login azure
docker context create aci corsproxycontext
docker context use corsproxycontext
docker run -d --name cors-proxy-container -p 7979:7979 -e ORIGIN_ALLOW_LIST=https://example.com dsdevcenter/cors-proxy

The last command might take a while. Once it's done list Docker containers under corsproxycontext ACI context in order to view the host name and port:

docker ps
# CONTAINER ID           IMAGE                    COMMAND             STATUS              PORTS
# cors-proxy-container   dsdevcenter/cors-proxy                       Running             123.456.789.012:7979->7979/tcp

Deploy to Heroku

heroku login
heroku create <unique-app-name>
heroku config:set ORIGIN_ALLOW_LIST=https://example.com
git commit -m "first commit"
git push heroku main

Heroku deploys apps to HTTPS port 443 by default so you can test the setup by running:

curl https://<unique-app-name>.herokuapp.com/https://demo.docusign.net/restapi

Deploy to any Linux-like environment

docker pull dsdevcenter/cors-proxy
docker run -d --name cors-proxy-container -p 7979:7979 -e ORIGIN_ALLOW_LIST=https://example.com dsdevcenter/cors-proxy

Docker setup

Image creation

docker build --tag cors-proxy .

Container creation

docker run -d --name cors-proxy-container -p 7979:7979 -e ORIGIN_ALLOW_LIST=https://example.com dsdevcenter/cors-proxy

cors-proxy's People

Contributors

mmallis87 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.