Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

sehnryr/cors-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cors-proxy

A Flask-based proxy that adds CORS headers to every responses.

Note: Every headers are forwarded but Content-Encodind that causes issues with Flask and Forbidden headers. Cookies path are removed as it won't correspond the proxy path.

Table of Contents

Installation

Install the dependencies with

pip install -r requirements.txt

You can either run the proxy with

# for local debugging
python proxy.py

# for production
gunicorn -b 0.0.0.0:8080 server:app

Or deploy it with Fly.io with the Dockerfile. Ensure to install flyctl beforhand.

Usage

You can then access http://127.0.0.1:5000/<url> for any url and any HTTP method. The response content and return code will be forwarded.

Example: Access https://jsonplaceholder.typicode.com/posts with http://127.0.0.1:5000/https://jsonplaceholder.typicode.com/posts.

About

Simple Flask-based CORS proxy

Topics

Resources

Stars

Watchers

Forks

Languages

  • Python 93.2%
  • Dockerfile 6.8%