{ "info": { "author": "Oliver Tonnhofer", "author_email": "olt@bogosoft.com", "bugtrack_url": null, "classifiers": [], "description": "Corsa\n=====\n\nCorsa proxies HTTP requests, adds `CORS headers `_ and can also serve your static web application.\n\nFeatures:\n\n- proxy requests for ``/proxy/http://host/path`` to ``http://host/path``\n- set ``Access-Control-Allow-Origin`` headers\n- support for CORS preflight requests\n- support for GET, HEAD, POST, PUT, DELETE, OPTIONS\n- serve static content from ``/app/`` (``--app-dir``)\n- limit proxy hosts (``--allow-proxy``)\n- limit origin (``--allow-origin``)\n\n\nCorsa is powered by Python and Tornado and is licensed under the MIT license.\n\n\nExample\n-------\n\nYou have a static web app in ``./mywebapp`` that loads images from ``http://imagesource.example`` and stores them in a local CouchDB?\nDue 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.\nCross-origin resource sharing (CORS) is a mechanism to work around that and Corsa will set the appropriate CORS headers for you.\n\nStart Corsa::\n\n % corsa --app-dir ./mywebapp --allow-proxy http://imagesource.example,http://localhost:5984\n\nConfigure 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``.\n\n\nIf you application is allready running at ``http://localhost:8080``::\n\n % corsa --allow-proxy http://imagesource.example,http://localhost:5984 --allow-origin http://localhost:8080\n\n\nOptions\n-------\n\nTo proxy specific URLs::\n\n % corsa --allow-proxy http://httpbin.org --allow-origin ALL\n\n % curl http://localhost:8888/proxy/http://httpbin.org/get -D -\n HTTP/1.1 200 OK\n Access-Control-Allow-Origin: *\n [...]\n\n\nYou can restrict proxying to specific origins. Origin should be the host where your requests to Corsa comes from.\n\n::\n\n % corsa --allow-proxy http://httpbin.org --allow-origin http://myexample\n\n % curl http://localhost:8888/proxy/http://httpbin.org/get -H 'Origin: http://myexample' -D -\n HTTP/1.1 200 OK\n Access-Control-Allow-Origin: http://myexample\n [...]\n\n % curl http://localhost:8888/proxy/http://httpbin.org/get -H 'Origin: http://otherdomain' -D -\n HTTP/1.1 403 Forbidden\n [...]\n\n\n\nYou can also host a static web app with Corsa::\n\n % mkdir app\n % echo 'hello' >> app/index.html\n % corsa --app-dir app\n\n % curl http://localhost:8888/app/index.html -D -\n HTTP/1.1 200 OK\n Content-Length: 6\n [...]\n Content-Type: text/html\n\n hello\n\n``--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.\n\nYou can permit all origins and proxy hosts with the ``ALL`` alias::\n\n % corsa --allow-proxy ALL --allow-origin ALL\n\n % curl http://localhost:8888/proxy/https://github.com/ -D -\n HTTP/1.1 200 OK\n [...]\n\n\nCorsa listens to http://localhost:8888 by default, but you can change that with the ``--bind`` option::\n\n % corsa --bind :9999\n % corsa --bind 0.0.0.0\n % corsa --bind 0.0.0.0:9090\n\n\nInstallation\n------------\n\nCorsa is written in Python and requires `Tornado `_.\nIt was tested with Python 2.7/3.3 and Tornado 3.1.\n\nCorsa is `hosted on pypi `_ so you can install it with::\n\n pip install corsa\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/olt/corsa", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "corsa", "package_url": "https://pypi.org/project/corsa/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/corsa/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/olt/corsa" }, "release_url": "https://pypi.org/project/corsa/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "CORS proxy and web server for static apps", "version": "0.1.2" }, "last_serial": 863758, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "11aa93dd63b0dd2d7fb455f7ec021eba", "sha256": "8c8747e8379b79e046efb9b6d369a302daf60627f4edde8a242a576b6258891e" }, "downloads": -1, "filename": "corsa-0.1.0.tar.gz", "has_sig": false, "md5_digest": "11aa93dd63b0dd2d7fb455f7ec021eba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4349, "upload_time": "2013-08-22T15:42:55", "url": "https://files.pythonhosted.org/packages/55/d2/e1729aa7ed9d09c10aa645d7ebcb79637b1c2531c7076d928d7a145fb753/corsa-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8dc4f426ad50660f315be876562eaf7c", "sha256": "6d0cfbc1b5f3f819554e276623c4c86b51acdad5897cfd967c32565c59a77741" }, "downloads": -1, "filename": "corsa-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8dc4f426ad50660f315be876562eaf7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4380, "upload_time": "2013-08-26T14:30:40", "url": "https://files.pythonhosted.org/packages/6a/b9/6a0a074337efdb43ec6ab892ba5491f87fd67e052f97199be827f3ed9f4d/corsa-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "de4da35958e9e9048eec6b2849573bf3", "sha256": "15f86dc5839c780647ea7f7fabcc90a4973c61b71e3d1d85276f30e35e3fdd49" }, "downloads": -1, "filename": "corsa-0.1.2.tar.gz", "has_sig": false, "md5_digest": "de4da35958e9e9048eec6b2849573bf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4437, "upload_time": "2013-09-12T13:46:24", "url": "https://files.pythonhosted.org/packages/c0/a3/08e54876ed5d84f733aa2abab345e8f81ac5a6f634931fede82a25f5e9e4/corsa-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de4da35958e9e9048eec6b2849573bf3", "sha256": "15f86dc5839c780647ea7f7fabcc90a4973c61b71e3d1d85276f30e35e3fdd49" }, "downloads": -1, "filename": "corsa-0.1.2.tar.gz", "has_sig": false, "md5_digest": "de4da35958e9e9048eec6b2849573bf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4437, "upload_time": "2013-09-12T13:46:24", "url": "https://files.pythonhosted.org/packages/c0/a3/08e54876ed5d84f733aa2abab345e8f81ac5a6f634931fede82a25f5e9e4/corsa-0.1.2.tar.gz" } ] }