![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Corsa proxies HTTP requests, adds CORS headers <http://en.wikipedia.org/wiki/Cross-origin_resource_sharing>
_ and can also serve your static web application.
Features:
/proxy/http://host/path
to http://host/path
Access-Control-Allow-Origin
headers/app/
(--app-dir
)--allow-proxy
)--allow-origin
)Corsa is powered by Python and Tornado and is licensed under the MIT license.
You have a static web app in ./mywebapp
that loads images from http://imagesource.example
and stores them in a local CouchDB?
Due to the cross-domain restrictions of all modern browsers, you won't be able to access the image data and you won't be able to access the CouchDB.
Cross-origin resource sharing (CORS) is a mechanism to work around that and Corsa will set the appropriate CORS headers for you.
Start Corsa::
% corsa --app-dir ./mywebapp --allow-proxy http://imagesource.example,http://localhost:5984
Configure your web app to use /proxy/http://imagesource.example
as the image source and /proxy/http://localhost:5984
as your CouchDB URL and go to http://localhost:8888/app/index.html
.
If you application is allready running at http://localhost:8080
::
% corsa --allow-proxy http://imagesource.example,http://localhost:5984 --allow-origin http://localhost:8080
To proxy specific URLs::
% corsa --allow-proxy http://httpbin.org --allow-origin ALL
% curl http://localhost:8888/proxy/http://httpbin.org/get -D -
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
[...]
You can restrict proxying to specific origins. Origin should be the host where your requests to Corsa comes from.
::
% corsa --allow-proxy http://httpbin.org --allow-origin http://myexample
% curl http://localhost:8888/proxy/http://httpbin.org/get -H 'Origin: http://myexample' -D -
HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://myexample
[...]
% curl http://localhost:8888/proxy/http://httpbin.org/get -H 'Origin: http://otherdomain' -D -
HTTP/1.1 403 Forbidden
[...]
You can also host a static web app with Corsa::
% mkdir app
% echo 'hello' >> app/index.html
% corsa --app-dir app
% curl http://localhost:8888/app/index.html -D -
HTTP/1.1 200 OK
Content-Length: 6
[...]
Content-Type: text/html
hello
--allow-origin
defaults to SELF
which is an alias for the URL of the Corsa server. This way your web app is able to make requests to all --allow-proxy
hosts by default.
You can permit all origins and proxy hosts with the ALL
alias::
% corsa --allow-proxy ALL --allow-origin ALL
% curl http://localhost:8888/proxy/https://github.com/ -D -
HTTP/1.1 200 OK
[...]
Corsa listens to http://localhost:8888 by default, but you can change that with the --bind
option::
% corsa --bind :9999
% corsa --bind 0.0.0.0
% corsa --bind 0.0.0.0:9090
Corsa is written in Python and requires Tornado <http://www.tornadoweb.org/>
_.
It was tested with Python 2.7/3.3 and Tornado 3.1.
Corsa is hosted on pypi <http://pypi.python.org/pypi/corsa>
_ so you can install it with::
pip install corsa
FAQs
CORS proxy and web server for static apps
We found that corsa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.