A Clojure server based on the super fast http-kit for proxying files as if they came from your very own domain (for CORS protection)
infrastructure
Stephen Starkey ad60fc378b Port from fossil 1 year ago
bin First commit 1 year ago
doc First commit 1 year ago
resources/public Added a ping to cut down on service logging 1 year ago
src/cors_proxy Better docs 1 year ago
.gitignore Port from fossil 1 year ago
CHANGELOG.md First commit 1 year ago
LICENSE First commit 1 year ago
README.md Port from fossil 1 year ago
project.clj Java 10 prep. Better test. 1 year ago

README.md

cors-proxy

A very simple proxy for files that browsers tend to block, especially on pages that have very strict cross-origin requirements. Meant to be run behind a reverse proxy. For more information about how to set this up:

http://www.http-kit.org/server.html#deploy

Prerequisites

In order to run this service, you’ll need at least JDK 9. To get this going on a Mac:

http://davidcai.github.io/blog/posts/install-multiple-jdk-on-mac/

Or Ubuntu 16.04:

https://stackoverflow.com/questions/49507160/how-to-install-jdk-10-under-ubuntu

You’ll also need to get Leiningen.

Usage

See bin/local for an example. The regular expression is basically a pattern that will be executed against the Origin header of every request. If it matches, the file will be fetched and fed back to the client.

To test that the server is working, after running bin/local visit:

http://localhost:8090/?test=true

Logs

Logs will be written to cors-proxy.log

License

Copyright © 2018 Stephen Starkey

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.