{"id":18930033,"url":"https://github.com/labd/wsgi-aws-unproxy","last_synced_at":"2025-08-25T15:17:58.683Z","repository":{"id":62589612,"uuid":"91693357","full_name":"labd/wsgi-aws-unproxy","owner":"labd","description":"Process X-Forwarded-For headers for AWS","archived":false,"fork":false,"pushed_at":"2020-03-30T12:07:31.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T22:51:11.351Z","etag":null,"topics":["aws","django","wsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labd.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-18T12:57:38.000Z","updated_at":"2020-04-03T15:52:43.000Z","dependencies_parsed_at":"2022-11-03T17:54:27.276Z","dependency_job_id":null,"html_url":"https://github.com/labd/wsgi-aws-unproxy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwsgi-aws-unproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwsgi-aws-unproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwsgi-aws-unproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwsgi-aws-unproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labd","download_url":"https://codeload.github.com/labd/wsgi-aws-unproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248933349,"owners_count":21185461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","django","wsgi"],"created_at":"2024-11-08T11:36:19.362Z","updated_at":"2025-04-15T15:31:13.877Z","avatar_url":"https://github.com/labd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. start-no-pypi\n\n.. image:: https://github.com/labd/wsgi-aws-unproxy/workflows/Python%20Tests/badge.svg\n    :target: https://github.com/labd/wsgi-aws-unproxy/actions\n    \n.. image:: http://codecov.io/github/LabD/wsgi-aws-unproxy/coverage.svg?branch=master\n    :target: http://codecov.io/github/LabD/wsgi-aws-unproxy?branch=master\n\n.. image:: https://img.shields.io/pypi/l/wsgi-aws-unproxy.svg\n    :target: https://pypi.python.org/pypi/wsgi-aws-unproxy/\n\n.. image:: https://img.shields.io/pypi/v/wsgi-aws-unproxy.svg\n    :target: https://pypi.python.org/pypi/wsgi-aws-unproxy/\n\n.. end-no-pypi\n\n\n================\nWSGI AWS Unproxy\n================\n\nSet the correct ``REMOTE_ADDR`` based on the ``X-Forwarded-For`` header,\nwhile only trusting the CloudFront IP addresses.\n\nThis module is applied as WSGI middleware, fixing the IP-address retrieval for the entire application in a secure manner.\nAs extra benefit, external packages no longer have to write abstraction layers to retrieve the IP-address header.\n\n\nDjango example\n==============\n\nIn Django edit the ``wsgi.py`` file to apply the module:\n\n.. code-block:: python\n\n    from django.core.wsgi import get_wsgi_application\n    from wsgi_aws_unproxy import UnProxy\n\n    application = get_wsgi_application()\n    application = UnProxy(application)\n\nNow all packages can just read ``request.META['REMOTE_ADDR']`` to fetch the correct IP.\nThis includes contact forms, Sentry error reporting and rate limiting tools.\n\n\nInstallation\n============\n\nYou can install the latest version using pip:\n\n.. code-block:: bash\n\n    pip install wsgi-aws-unproxy\n\nAnd apply it as WSGI middleware:\n\n.. code-block:: python\n\n    from wsgi_aws_unproxy import UnProxy\n\n    application = UnProxy(application)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fwsgi-aws-unproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabd%2Fwsgi-aws-unproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fwsgi-aws-unproxy/lists"}