A tiny CORS Anywhere proxy made with Go
851
A tiny CORS Anywhere proxy made with Go.
Adds CORS headers to each request to be able to call APIs that require CORS, without setting up your own server. Just start up this Docker container and start sending requests.
All requests to this proxy are allowed with this header: Access-Control-Allow-Origin: *! and proxied to the supplied URL. Also see CORS Anywhere and enable-cors.org.
The most popular CORS Anywhere image (500k+ downloads at time of writing), uses the node:10-stretch image making it 337MB big, which is a lot for what it does.
One of the smaller ones just uses an Nginx configuration and is 17MB.
This one uses Go (which compiles to a binary) and is an excellent candidate for multi-stage builds. The result is an image of just ~12MB!
When running on the default port, e.g. go to http://localhost:3000/?get=https://www.mdworld.nl
go run tinycors.go
or with optional flags:
go run tinycors.go -port 9009 -origins http://localhost:3000
or build first:
go build tinycors.go
./tinycors
docker build -t mdworld/tinycors .
docker run --rm --name tinycors -p 3000:3000 mdworld/tinycors
or with optional flags:
docker run --rm --name tinycors -p 9009:9009 mdworld/tinycors -port 9009 -origins http://localhost:3000
Content type
Image
Digest
Size
6.3 MB
Last updated
almost 6 years ago
docker pull mdworld/tinycors