{"id":13610480,"url":"https://github.com/mattt/NSEtcHosts","last_synced_at":"2025-04-12T22:33:58.253Z","repository":{"id":16087228,"uuid":"18831922","full_name":"mattt/NSEtcHosts","owner":"mattt","description":"/etc/hosts with NSURLProtocol","archived":true,"fork":false,"pushed_at":"2019-07-11T15:37:10.000Z","size":54,"stargazers_count":664,"open_issues_count":0,"forks_count":78,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-07T16:43:49.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/mattt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-16T08:08:39.000Z","updated_at":"2024-10-29T16:32:55.000Z","dependencies_parsed_at":"2022-09-16T18:23:26.735Z","dependency_job_id":null,"html_url":"https://github.com/mattt/NSEtcHosts","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/mattt%2FNSEtcHosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FNSEtcHosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FNSEtcHosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FNSEtcHosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattt","download_url":"https://codeload.github.com/mattt/NSEtcHosts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642222,"owners_count":21138348,"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-01T19:01:45.094Z","updated_at":"2025-04-12T22:33:58.005Z","avatar_url":"https://github.com/mattt.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# NSEtcHosts\n\n\u003e This project was a proof-of-concept that relied on a combination of factors unique to the time of creation \n\u003e that have since been remediated by, among other things,\n\u003e the ubiquitous adoption of HTTPS, iOS App Transport Security, and `NSURLSession`.\n\u003e Insofar as this approach should ever have been used (it shouldn't)\n\u003e the aforementioned improvements to the networking stack render this project inviable.\n\u003e Suffice to say, this project is no longer maintained.\n\nNSEtcHosts uses `NSURLProtocol` to intercept requests for specified host names, \nresolving them instead to a different IP address, \nsimilar to an [`/etc/hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29) on a Unix system. \n(This does not actually affect the _actual_ hosts file used by iOS, \nnor does it affect routing behavior outside of the application process)\n\n## Usage\n\n```objective-c\n[NSURLProtocol registerClass:[EtcHostsURLProtocol class]];\n[EtcHostsURLProtocol configureHostsWithBlock:^(id \u003cEtcHostsConfiguration\u003e configuration) {\n    [configuration resolveHostName:@\"google.com\" toIPAddress:@\"98.138.253.109\"];\n}];\n```\n\n## Contact\n\n[Mattt](https://twitter.com/mattt)\n\n## License\n\nNSEtcHosts is available under the MIT license. \nSee the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FNSEtcHosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattt%2FNSEtcHosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FNSEtcHosts/lists"}