All Projects → imjacobclark → Cors Container

imjacobclark / Cors Container

Licence: mit
A CORS proxy in a container (Docker) for when you need to `Access-Control-Allow-Origin: *`!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Cors Container

Corsy
CORS Misconfiguration Scanner
Stars: ✭ 756 (+404%)
Mutual labels:  cors
Nodefony Starter
Nodefony Starter Node.js Framework
Stars: ✭ 95 (-36.67%)
Mutual labels:  cors
Apiproject
[https://www.sofineday.com], golang项目开发脚手架,集成最佳实践(gin+gorm+go-redis+mongo+cors+jwt+json日志库zap(支持日志收集到kafka或mongo)+消息队列kafka+微信支付宝支付gopay+api加密+api反向代理+go modules依赖管理+headless爬虫chromedp+makefile+二进制压缩+livereload热加载)
Stars: ✭ 124 (-17.33%)
Mutual labels:  cors
Laravel Api Boilerplate Jwt
A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.
Stars: ✭ 1,155 (+670%)
Mutual labels:  cors
Corser
CORS middleware for Node.js
Stars: ✭ 90 (-40%)
Mutual labels:  cors
Typescript Restful Starter
Node.js + ExpressJS + Joi + Typeorm + Typescript + JWT + ES2015 + Clustering + Tslint + Mocha + Chai
Stars: ✭ 97 (-35.33%)
Mutual labels:  cors
Learn Nginx
Nginx 入门指南
Stars: ✭ 728 (+385.33%)
Mutual labels:  cors
Browser Preview
🎢Preview html file in your default browser
Stars: ✭ 148 (-1.33%)
Mutual labels:  cors
Cors Now
reverse proxy with CORS headers.
Stars: ✭ 93 (-38%)
Mutual labels:  cors
Nelmiocorsbundle
The NelmioCorsBundle allows you to send Cross-Origin Resource Sharing headers with ACL-style per-URL configuration.
Stars: ✭ 1,615 (+976.67%)
Mutual labels:  cors
Public Cakephp Rest Api
CakePHP 3 plugin for building REST API services
Stars: ✭ 71 (-52.67%)
Mutual labels:  cors
Lumen Cors
CORS module for the Lumen PHP framework.
Stars: ✭ 88 (-41.33%)
Mutual labels:  cors
Gin Cors
Cross Origin Resource Sharing middleware for gin-gonic
Stars: ✭ 107 (-28.67%)
Mutual labels:  cors
Java Sec Code
Java web common vulnerabilities and security code which is base on springboot and spring security
Stars: ✭ 1,033 (+588.67%)
Mutual labels:  cors
Egg Cors
CORS plugin for egg
Stars: ✭ 140 (-6.67%)
Mutual labels:  cors
Node Typescript Koa Rest
REST API boilerplate using NodeJS and KOA2, typescript. Logging and JWT as middlewares. TypeORM with class-validator, SQL CRUD. Docker included. Swagger docs, actions CI and valuable README
Stars: ✭ 739 (+392.67%)
Mutual labels:  cors
Ecommerce Nodejs
Ecommerce application back-end codes
Stars: ✭ 97 (-35.33%)
Mutual labels:  cors
Cors Vulnerable Lab
Sample vulnerable code and its exploit code
Stars: ✭ 149 (-0.67%)
Mutual labels:  cors
Sanic Cors
A Sanic extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. Based on flask-cors by Cory Dolphin.
Stars: ✭ 143 (-4.67%)
Mutual labels:  cors
Workers
Cloudflare Workers
Stars: ✭ 111 (-26%)
Mutual labels:  cors

cors-container

A CORS proxy in a container (Docker) for when you need to Access-Control-Allow-Origin: *!

Build Status Docker Pulls

You can use CORS Container without running it yourself via Heroku (it's on a free tier dyno, so initial startup time may be slow!) https://cors-container.herokuapp.com.

About

If you need permissive CORS for a front-end project, simply deploy this container and proxy your HTTP requests through it.

Once the container is running, you may navigate to http://container-address:3000/https://jacobclark.xyz, cors-container will then proxy the specified resource and transform the original headers to be CORS permissive, whilst keeping origional headers in-tact.

If you intend to use this in production over the open web, ensure the service is locked down with restrictive firewall/access permissions, otherwise any content may be proxied over your server.

I suggest implementing proper CORS headers on your resources and using this for development purposes only.

Relative URL rewriting

cors-container can rewrite relative URLs to full URLs of the response body you have proxied.

For example if we wish to proxy http://blog.jacobclark.xyz/ and cors-container is runinnng on http://localhost:3000/ the request URL would be http://localhost:3000/http://blog.jacobclark.xyz/.

cors-container will rewrite any relative URLs it finds in the proxies response body. For example <a href="/css/style.css"> would be modified to <a href="http://localhost:3000/http://blog.jacobclark.xyz/css/style.css"> in the proxied response.

This can be useful if you wish to be able to pull additional assets on a page through the proxy such as stylesheets and JavaScript.

This is not enabled by default as this option mutates the original response body.

Set rewrite-urls in the request header to cors-cotainer if you want relative URLs rewriting.

Deploying

Docker(hub)

$ docker pull imjacobclark/cors-container
$ docker run --restart=always -d -p 3000:3000 --name cors-container imjacobclark/cors-container

Docker(source)

$ git pull https://github.com/imjacobclark/cors-container.git && cd cors-container
$ docker build -t cors-container .
$ docker run --restart=always -d -p 3000:3000 --name cors-container cors-container

Node

$ git pull https://github.com/imjacobclark/cors-container.git && cd cors-container
$ npm run test && npm start

Thanks to

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].