GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hopein/NSEtcHosts: /etc/hosts with NSURLProtocol

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
Example
Example
 
 
NSEtcHosts.xcworkspace
NSEtcHosts.xcworkspace
 
 
NSEtcHosts
NSEtcHosts
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

NSEtcHosts

NSEtcHosts uses NSURLProtocol to intercept requests for specified host names, resolving them instead to a different IP address, similar to an /etc/hosts file on a Unix system. (This does not actually affect the actual hosts file used by iOS, nor does it affect routing behavior outside of the application process)

This is a proof-of-concept, and is not intended for use in production.

Usage

[NSURLProtocol registerClass:[EtcHostsURLProtocol class]];
[EtcHostsURLProtocol configureHostsWithBlock:^(id <EtcHostsConfiguration> configuration) {
    [configuration resolveHostName:@"google.com" toIPAddress:@"98.138.253.109"];
}];

NSEtcHosts in Action

NSURL *URL = [NSURL URLWithString:@"http://google.com"];
[webView loadRequest:[NSURLRequest requestWithURL:URL]];

Contact

Mattt Thompson @mattt

License

NSEtcHosts is available under the MIT license. See the LICENSE file for more info.

About

/etc/hosts with NSURLProtocol

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.