{"id":17399296,"url":"https://github.com/feross/detect-proxy","last_synced_at":"2025-03-02T05:26:29.182Z","repository":{"id":4412937,"uuid":"5550506","full_name":"feross/detect-proxy","owner":"feross","description":"Using \u003cimg\u003e to detect whether the user is browsing through a proxy or not.","archived":false,"fork":false,"pushed_at":"2014-12-22T09:16:58.000Z","size":114,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-07T00:37:49.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://feross.org/detect-proxy-usage-in-firefox/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-25T10:24:13.000Z","updated_at":"2022-12-05T22:21:24.000Z","dependencies_parsed_at":"2022-09-20T05:53:19.716Z","dependency_job_id":null,"html_url":"https://github.com/feross/detect-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fdetect-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fdetect-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fdetect-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fdetect-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feross","download_url":"https://codeload.github.com/feross/detect-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241463905,"owners_count":19967140,"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":[],"created_at":"2024-10-16T15:15:16.815Z","updated_at":"2025-03-02T05:26:29.161Z","avatar_url":"https://github.com/feross.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# detect-proxy\n\n### This repo is unmaintained and this technique may not work anymore.\n\nBy [Feross Aboukhadijeh](http://feross.org).\n\nThis code allows a malicious website to **detect whether the user is browsing through a proxy or not** by using image tags. Proxies are often used by corporations, political dissidents, and privacy conscience Internet users because they can provide additional security or anonymous Internet browsing.\n\n## Here's how it works\n\nFirefox uses square brackets `[ ]` to denote IPv6 addresses, but this notation also works to describe IPv4 addresses (I'm not sure exactly why).\n\nSo, if we embed an image with `src=\"http://[74.207.246.197]/pic.jpg\"` into a page, Firefox automatically resolves `[74.207.246.197]` into the IP address `74.207.246.197`.\n\nHowever, if the user is browsing through a proxy, this automatic resolution doesn't happen. Instead, Firefox asks the proxy to do a DNS lookup for the \"domain\" `[74.207.246.197]`, which obviously fails since it's not a valid domain name.\n\nMost proxies don't know how to handle the bracketed domain, so the DNS lookup fails. I've tested this on [Tor](http://www.torproject.org) (popular proxy for anonymous Internet browsing), [PHP Proxy](http://sourceforge.net/projects/php-proxy/) and [CGI Proxy](http://www.jmarshall.com/tools/cgiproxy/) (the top two web-based proxies), and [Proxify](http://www.proxify.com) (popular commercial web proxy).\n\nSo, if the image fails to load, we know that the user is browsing through a proxy. Add some Javascript to detect when the image fails to load and you've got a working proxy detector.\n\n**[View the demo](http://feross.org/hacks/detect-proxy/).**\n(Works in: Firefox 3, Safari 5)\n\nThis, of course, assumes that the user is not blocking cross-domain requests. Also, my implementation requires Javascript to be enabled, but that's not a necessity.\n\n## Read more about this\n\nOn [my blog](http://feross.org/detect-proxy-usage-in-firefox/).\n\n## MIT License\n\nCopyright (c) 2012 Feross Aboukhadijeh \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fdetect-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Fdetect-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fdetect-proxy/lists"}