{ "info": { "author": "Cole Krumbholz", "author_email": "cole@brace.io", "bugtrack_url": null, "classifiers": [], "description": "quickproxy\n==========\n\nA lightweight, asynchronous, programmable HTTP proxy for python. Built with Tornado.\n\n## Use\n\n#### A simple proxy:\n\n\timport quickproxy\n\tquickproxy.run_proxy(port=8080)\n\n\n#### A reverse proxy:\n\nThis proxy will fetch responses from an AWS s3 bucket with the same ID as the request's hostname.\n\n\tdef callback(request):\n\t\trequest.host = request.host+\".s3-website-us-east-1.amazonaws.com\"\n\t\trequest.port = 80\n\t\treturn request\n\n\tquickproxy.run_proxy(port=8080, req_callback=callback)\n\n\n## Reference\n\nQuickproxy exposes just one function:\n\n\trun_proxy(port,\n methods=['GET', 'POST'], \n req_callback=DEFAULT_CALLBACK,\n resp_callback=DEFAULT_CALLBACK,\n err_callback=DEFAULT_CALLBACK,\n start_ioloop=True)\n\nIt runs a proxy on the specified port. You can pass the following parameters to configure quickproxy:\n\n- methods: the HTTP methods this proxy will support\n\n- req_callback: a callback that is passed a RequestObj that it should\n modify and then return. By default this is the identity function.\n\n- resp_callback: a callback that is given a ResponseObj that it should\n modify and then return. By default this is the identity function.\n\n- err_callback: in the case of an error, this callback will be called.\n there's no difference between how this and the resp_callback are \n used. By default this is the identity function.\n\n- start_ioloop: if True (default), the tornado IOLoop will be started \n immediately.\n\n\n### Request callback functions\n\nThe request callback should receive a RequestObj and return a RequestObj.\n\n\trequest_callback(requestobj)\n\t\treturn requestobj\n\nThe RequestObj is a python object with the following attributes that can be modified before it is returned:\n\n- protocol: either 'http' or 'https'\n\n- host: the destination hostname of the request\n\n- port: the port for the request\n\n- path: the path of the request ('/index.html' for example)\n\n- query: the query string ('?key=value&other=value')\n\n- fragment: the hash fragment ('#fragment')\n\n- method: request method ('GET', 'POST', etc)\n\n- username: always passed as None, but you can set it to override the user\n\n- password: None, but can be set to override the password\n\n- body: request body as a string\n\n- headers: a dictionary of header / value pairs \n (for example {'Content-Type': 'text/plain', 'Content-Length': 200})\n\n- follow_redirects: true to follow redirects before returning a response\n\n\n### Response callback functions\n\nThe response and error callbacks should receive a ResponseObj and return a ResponseObj, similar to the request callback above.\n\nThe ResponseObj is a python object with the following attributes that can be modified before it is returned:\n\n- code: response code, such as 200 for 'OK'\n\n- headers: the response headers \n\n- pass_headers: a list or set of headers to pass along in the response. All\n other headers will be stripped out. By default this includes:\n\n `('Date', 'Cache-Control', 'Server', 'Content-Type', 'Location')`\n\n- body: response body as a string\n\n\n## Credits\n\nMuch of this code was adopted from Senko's tornado-proxy:\n\nhttps://github.com/senko/tornado-proxy\n\n...which is itself based on the code by Bill Janssen posted to: http://groups.google.com/group/python-tornado/msg/7bea08e7a049cf26", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "quickproxy", "package_url": "https://pypi.org/project/quickproxy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/quickproxy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/quickproxy/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "A lightweight, per-request customizable HTTP proxy for python.", "version": "0.2.0" }, "last_serial": 1007221, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "db5eb2f6e55d059f2197493311c62fe7", "sha256": "b4aeb5a7e321adf58eb566b29e58b8b873021e2b44eb904afeda23970c1a0755" }, "downloads": -1, "filename": "quickproxy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "db5eb2f6e55d059f2197493311c62fe7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6161, "upload_time": "2014-02-02T03:07:49", "url": "https://files.pythonhosted.org/packages/12/38/544ec1b96ffca9116ccd252bd052b48641f595d57dbe2c3fbac7b3c5bd16/quickproxy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "27b8b0c021facc8edd83a4f4f6b0910b", "sha256": "2a171d3fe10a51530c5f46bc3b02d0a35de472883e158af570fdaaa59d33e29e" }, "downloads": -1, "filename": "quickproxy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "27b8b0c021facc8edd83a4f4f6b0910b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6525, "upload_time": "2014-02-02T03:19:07", "url": "https://files.pythonhosted.org/packages/a2/61/7dfaba2103fb8596c9b514668a37ab25a45e9d69e352fc81b4024e56267b/quickproxy-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7575c64ae1cb873ca94ca5ab337e3b7b", "sha256": "9a434e44fd028f0558b03160bc6c93167dbe237263773ee37c14b5f057409bb0" }, "downloads": -1, "filename": "quickproxy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7575c64ae1cb873ca94ca5ab337e3b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6774, "upload_time": "2014-02-21T05:35:40", "url": "https://files.pythonhosted.org/packages/27/c7/3d03e61f576c0dd300c97fc9d780d152aed0841633bfd4dcbb79d7eedaab/quickproxy-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7575c64ae1cb873ca94ca5ab337e3b7b", "sha256": "9a434e44fd028f0558b03160bc6c93167dbe237263773ee37c14b5f057409bb0" }, "downloads": -1, "filename": "quickproxy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7575c64ae1cb873ca94ca5ab337e3b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6774, "upload_time": "2014-02-21T05:35:40", "url": "https://files.pythonhosted.org/packages/27/c7/3d03e61f576c0dd300c97fc9d780d152aed0841633bfd4dcbb79d7eedaab/quickproxy-0.2.0.tar.gz" } ] }