{ "info": { "author": "S\u00f8ren L\u00f8vborg", "author_email": "kwi@kwi.dk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: Proxy Servers", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "WsgiUnproxy\r\n===========\r\n\r\nWhen an HTTP proxy forwards traffic to a webserver, the server sees the proxy\r\nIP address rather than the original client IP address. Since the server may\r\nneed the IP address for logging or authentication purposes, many HTTP proxies\r\nadd an ``X-Forwarded-For`` header indicating the original client IP address.\r\n\r\nAs WSGI middleware, WsgiUnproxy sits between the WSGI server and your WSGI\r\napplication. Before your application sees a request, WsgiUnproxy removes the\r\n``X-Forwarded-For`` header and reinstates the client IP address, yielding a\r\nrequest that looks like it was never proxied to begin with.\r\n\r\nSince anyone can add an ``X-Forwarded-For`` header, WsgiUnproxy only uses the\r\nheader if it comes from a trusted proxy IP addresses.\r\n\r\n\r\nExample WSGI application\r\n------------------------\r\n\r\n::\r\n\r\n from wsgiunproxy import unproxy\r\n\r\n @unproxy(trusted_proxies=[ '1.2.3.4', '5.6.7.8' ])\r\n def application(environ, start_response):\r\n start_response('200 OK', [])\r\n return ['Your IP address is %s.' % environ.get('REMOTE_ADDR')]\r\n\r\n\r\nUse with Paste Deployment\r\n-------------------------\r\n\r\nWsgiUnproxy can be used in a Paste Deployment pipeline::\r\n\r\n [pipeline:main]\r\n pipeline =\r\n WsgiUnproxy\r\n MyApp\r\n\r\n [filter:WsgiUnproxy]\r\n use = egg:WsgiUnproxy\r\n trusted_proxies = 1.2.3.4, 5.6.7.8\r\n\r\n\r\nAdvanced use\r\n------------\r\n\r\nIf you need to specify a lot of trusted proxies (such as a whole subnet), you\r\ndon't have to use give ``trusted_proxies`` as a list. All that WsgiUnproxy asks\r\nis that ``trusted_proxies`` supports the ``in`` operator (e.g. by implementing\r\n``__contains__``).\r\n\r\n\r\nLicense\r\n-------\r\n\r\nTo the extent possible under law, the author has waived all copyright and\r\nrelated or neighboring rights to WsgiUnproxy.\r\n\r\nFor more information see:\r\nhttp://creativecommons.org/publicdomain/zero/1.0/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/kwi/wsgiunproxy/", "keywords": "", "license": "Public Domain", "maintainer": "", "maintainer_email": "", "name": "WsgiUnproxy", "package_url": "https://pypi.org/project/WsgiUnproxy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/WsgiUnproxy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/kwi/wsgiunproxy/" }, "release_url": "https://pypi.org/project/WsgiUnproxy/1.0/", "requires_dist": null, "requires_python": null, "summary": "Unproxy WSGI middleware", "version": "1.0" }, "last_serial": 753760, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a887bd14825c3ae74f04a8cca319c437", "sha256": "186903611ae8bbc2936deeeb649f222f973a1774ded9434de4db0716b501af95" }, "downloads": -1, "filename": "WsgiUnproxy-1.0.tar.gz", "has_sig": false, "md5_digest": "a887bd14825c3ae74f04a8cca319c437", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2857, "upload_time": "2011-08-18T16:32:59", "url": "https://files.pythonhosted.org/packages/47/d7/6f7bb56bf175b584922139f3b94c8444dd6b5c7ae541f75e2850bf607d2d/WsgiUnproxy-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a887bd14825c3ae74f04a8cca319c437", "sha256": "186903611ae8bbc2936deeeb649f222f973a1774ded9434de4db0716b501af95" }, "downloads": -1, "filename": "WsgiUnproxy-1.0.tar.gz", "has_sig": false, "md5_digest": "a887bd14825c3ae74f04a8cca319c437", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2857, "upload_time": "2011-08-18T16:32:59", "url": "https://files.pythonhosted.org/packages/47/d7/6f7bb56bf175b584922139f3b94c8444dd6b5c7ae541f75e2850bf607d2d/WsgiUnproxy-1.0.tar.gz" } ] }