{"id":13827023,"url":"https://github.com/oxtoacart/flashlight","last_synced_at":"2026-03-15T09:43:01.524Z","repository":{"id":19679151,"uuid":"22933077","full_name":"oxtoacart/flashlight","owner":"oxtoacart","description":"Lightweight host-spoofing web proxy written in go","archived":false,"fork":false,"pushed_at":"2014-08-04T20:18:51.000Z","size":1638,"stargazers_count":2,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T17:33:59.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"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/oxtoacart.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":"2014-08-13T22:17:03.000Z","updated_at":"2024-11-18T09:03:13.000Z","dependencies_parsed_at":"2022-08-24T14:08:04.582Z","dependency_job_id":null,"html_url":"https://github.com/oxtoacart/flashlight","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oxtoacart/flashlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxtoacart%2Fflashlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxtoacart%2Fflashlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxtoacart%2Fflashlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxtoacart%2Fflashlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxtoacart","download_url":"https://codeload.github.com/oxtoacart/flashlight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxtoacart%2Fflashlight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365699,"owners_count":23753379,"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-08-04T09:01:48.564Z","updated_at":"2026-03-15T09:42:56.478Z","avatar_url":"https://github.com/oxtoacart.png","language":null,"funding_links":[],"categories":["\u003ca id=\"295e14c39bf33cd5136be8ced9383746\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"f855508acfc870b1f0d90ff316f1dd75\"\u003e\u003c/a\u003e伪造\u0026\u0026Spoof"],"readme":"flashlight [![Travis CI Status](https://travis-ci.org/getlantern/flashlight.svg?branch=master)](https://travis-ci.org/getlantern/flashlight)\u0026nbsp;[![Coverage Status](https://coveralls.io/repos/getlantern/flashlight/badge.png)](https://coveralls.io/r/getlantern/flashlight)\u0026nbsp;[![GoDoc](https://godoc.org/github.com/getlantern/flashlight?status.png)](http://godoc.org/github.com/getlantern/flashlight)\n==========\n\nLightweight host-spoofing web proxy written in go.\n\nflashlight runs in one of two modes:\n\nclient - meant to run locally to wherever the browser is running, forwards\nrequests to the server\n\nserver - handles requests from a flashlight client proxy and actually proxies\nthem to the final destination\n\nUsing CloudFlare (and other CDNS), flashlight has the ability to masquerade as\nrunning on a different domain than it is.  The client simply specifies the\n\"masquerade\" flag with a value like \"thehackernews.com\".  flashlight will then\nuse that masquerade host for the DNS lookup and will also specify it as the\nServerName for SNI (though this is not actually necessary on CloudFlare). The\nHost header of the HTTP request will actually contain the correct host\n(e.g. getiantem.org), which causes CloudFlare to route the request to the\ncorrect host.\n\nFlashlight uses [enproxy](https://github.com/getlantern/enproxy) to encapsulate\ndata from/to the client as http request/response pairs.  This allows it to\ntunnel regular HTTP as well as HTTPS traffic over CloudFlare.  In fact, it can\ntunnel any TCP traffic.\n\n### Usage\n\n```bash\nUsage of flashlight:\n  -addr (required): ip:port on which to listen for requests.  When running as a client proxy, we'll listen with http, when running as a server proxy we'll listen with https\n  -configdir=\"\": directory in which to store configuration (defaults to current directory)\n  -cpuprofile=\"\": write cpu profile to given file\n  -dumpheaders=false: dump the headers of outgoing requests and responses to stdout\n  -help=false: Get usage help\n  -instanceid=\"\": instanceId under which to report stats to statshub.  If not specified, no stats are reported.\n  -masquerade=\"\": masquerade host: if specified, flashlight will actually make a request to this host's IP but with a host header corresponding to the 'server' parameter\n  -role (required): either 'client' or 'server'\n  -rootca=\"\": pin to this CA cert if specified (PEM format)\n  -server (required): FQDN of flashlight server\n  -serverport=443: the port on which to connect to the server\n```\n\n-rootca needs to be the complete PEM data, with header and trailer and all\nnewlines, for example:\n\n```\nflashlight -addr localhost:10080 -server localhost -serverport 10081 -rootca \"-----BEGIN CERTIFICATE-----\nMIIC/jCCAeigAwIBAgIEI6PHvjALBgkqhkiG9w0BAQswJjEQMA4GA1UEChMHTGFu\ndGVybjESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTE0MDUwMzE5NTQzMFoXDTI0MDYw\nMzE5NTQzMFowJjEQMA4GA1UEChMHTGFudGVybjESMBAGA1UEAxMJbG9jYWxob3N0\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzYeEJ/wJMeu0LA9/DLuw\nn0j9HmAu/CK34e1jXsUuGkuheLLYWC32jVMsQdYaWuv8wFf2soXYH3WoEfOUkpTJ\nN53WA4mmRd2nZidUxvUIiLdcQlJf+xar7vJih5MgsMYmVR+r7C1fLYlONuFpM6XV\n5VuixGZyOcrLcOBbW1NimZLDzFYqAMy6l6U3eKvjK8KasnPURlAnVKRLquf4WA41\ndiQXWAzJCVgPz/f3Z4nL/SCADOkc2nGOroh63xbIra1eQdKfn8fOU1qeq/Bl1gPq\nOdnSTGO19quSyf8XB6bDyl3TNeBCV5/FLIp8fjFzVdPAdZFjmMWTv3ccCEpmjsZe\nxwIDAQABozgwNjAOBgNVHQ8BAf8EBAMCAKQwEwYDVR0lBAwwCgYIKwYBBQUHAwEw\nDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsDggEBAFLDvZBjdhLZuyHL3q6G\nZC93zaGkpdS8ux3gw4lldtr/SYW8aJ9Ck4+aGv7kouFylAAmxUXODUqh8vG1mc7D\nuGHn5DHzHjlY1pSaedhcDcWIk1WB7ENoncWI9ZoutP3A4A+GTjwK35G7gBCP6bD+\nqI6VIezWU0oFlFOgTdIKHNEbFpEgIUm1WUhrQ1zzRGVNVNxo4YZyqxe3pVKNwSmx\nQggkGR2oOUVjfoyZ3pbUca4YnxiDgWRnbehgdK6Acq0kT9SCYAP0qTXCwZTeRJog\nNa7vvprDERbUvc9c0rSUGHUrKqbf5AAmStI6fHGTNvdOMHZfoekwrE0CbyWcX/UH\ngcA=\n-----END CERTIFICATE-----\"\n```\n\n**IMPORTANT** - when running a test locally, run the server first, then pass the\ncontents of servercert.pem to the client flashlight with the -rootca flag.  This\nway the client will trust the local server, which is using a self-signed cert.\n\nExample Client:\n\n```bash\n./flashlight -addr localhost:10080 -server getiantem.org -masquerade cdnjs.com\n```\n\nExample Server:\n\n```bash\n./flashlight -addr :443\n```\n\nExample Curl Test:\n\n```bash\ncurl -x localhost:10080 http://www.google.com/humans.txt\nGoogle is built by a large team of engineers, designers, researchers, robots, and others in many different sites across the globe. It is updated continuously, and built with more tools and technologies than we can shake a stick at. If you'd like to help us out, see google.com/careers.\n```\n\nOn the client, you should see something like this for every request:\n\n```bash\nHandling request for: http://www.google.com/humans.txt\n```\n\n### Building\n\nFlashlight requires [Go 1.3](http://golang.org/dl/).\n\nIt is convenient to build flashlight for multiple platforms using something like\n[goxc](https://github.com/laher/goxc).\n\nWith goxc, the binaries used for Lantern can be built like this:\n\n```\ngoxc -build-ldflags=\"-w\" -bc=\"linux,386 linux,amd64 windows,386 darwin\" validate compile\n```\n\n`-build-ldflags=\"-w\"` causes the linker to omit debug symbols, which makes the\nresulting binaries considerably smaller.\n\nThe binaries end up at\n`$GOPATH/bin/flashlight-xc/snapshot/\u003cplatform\u003e/flashlight`.\n\nNote that these binaries should also be signed for use in production, at least on OSX and Windows. On OSX the command to do this should resemble the following (assuming you have an associated code signing certificate):\n\n```\ncodesign -s \"Developer ID Application: Brave New Software Project, Inc\" -f install/osx/pt/flashlight/flashlight\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxtoacart%2Fflashlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxtoacart%2Fflashlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxtoacart%2Fflashlight/lists"}