iOS使用 NSURLProtocol 拦截 HTTP 请求的简单例子

上传者: u011018979 | 上传时间: 2021-04-19 14:05:55 | 文件大小: 151KB | 文件类型: ZIP
iOS
1、文章:https://kunnan.blog.csdn.net/article/details/115690756 2、原理:利用NSURLProtocol 拦截 HTTP 请求 3、应用场景:隧道APP请求我们自己接口的都不走隧道、修改请求的HTTPHeaderField,设置代理IP和端口、防抓包(使Thor,Charles,Burp等代理抓包方式全部失效)

文件下载

资源详情

[{"title":"( 42 个子文件 151KB ) iOS使用 NSURLProtocol 拦截 HTTP 请求的简单例子","children":[{"title":"CustomHTTPProtocolByNSURLProtocol-master","children":[{"title":".gitignore <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":"CustomHTTPProtocol.xcodeproj","children":[{"title":"project.xcworkspace","children":[{"title":"contents.xcworkspacedata <span style='color:#111;'> 163B </span>","children":null,"spread":false},{"title":"xcshareddata","children":[{"title":"IDEWorkspaceChecks.plist <span style='color:#111;'> 238B </span>","children":null,"spread":false}],"spread":true},{"title":"xcuserdata","children":[{"title":"mac.xcuserdatad","children":[{"title":"UserInterfaceState.xcuserstate <span style='color:#111;'> 48.43KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"project.pbxproj <span style='color:#111;'> 21.84KB </span>","children":null,"spread":false},{"title":"xcuserdata","children":[{"title":"mac.xcuserdatad","children":[{"title":"xcschemes","children":[{"title":"xcschememanagement.plist <span style='color:#111;'> 353B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"CustomHTTPProtocol","children":[{"title":"Main.storyboard <span style='color:#111;'> 4.07KB </span>","children":null,"spread":false},{"title":"AppDelegate.h <span style='color:#111;'> 2.45KB </span>","children":null,"spread":false},{"title":"ThreadInfo.h <span style='color:#111;'> 3.30KB </span>","children":null,"spread":false},{"title":"Core Code","children":[{"title":"CacheStoragePolicy.h <span style='color:#111;'> 3.24KB </span>","children":null,"spread":false},{"title":"CustomHTTPProtocol.m <span style='color:#111;'> 32.28KB </span>","children":null,"spread":false},{"title":"CacheStoragePolicy.m <span style='color:#111;'> 4.92KB </span>","children":null,"spread":false},{"title":"QNSURLSessionDemux.h <span style='color:#111;'> 4.75KB </span>","children":null,"spread":false},{"title":"QNSURLSessionDemux.m <span style='color:#111;'> 12.28KB </span>","children":null,"spread":false},{"title":"CanonicalRequest.m <span style='color:#111;'> 18.11KB </span>","children":null,"spread":false},{"title":"CustomHTTPProtocol.h <span style='color:#111;'> 9.18KB </span>","children":null,"spread":false},{"title":"CanonicalRequest.h <span style='color:#111;'> 3.37KB </span>","children":null,"spread":false}],"spread":true},{"title":"CredentialsManager.m <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"ThreadInfo.m <span style='color:#111;'> 2.92KB </span>","children":null,"spread":false},{"title":"WebViewController.h <span style='color:#111;'> 3.99KB </span>","children":null,"spread":false},{"title":"Icons","children":[{"title":"Icon-Small@2x.png <span style='color:#111;'> 1010B </span>","children":null,"spread":false},{"title":"iTunesArtwork <span style='color:#111;'> 5.07KB </span>","children":null,"spread":false},{"title":"Icon.png <span style='color:#111;'> 1007B </span>","children":null,"spread":false},{"title":"Icon-Small.png <span style='color:#111;'> 918B </span>","children":null,"spread":false},{"title":"Icon@2x.png <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false},{"title":"Icon-72.png <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"Icon-Small-50.png <span style='color:#111;'> 992B </span>","children":null,"spread":false}],"spread":true},{"title":"main.m <span style='color:#111;'> 2.58KB </span>","children":null,"spread":false},{"title":"Info.plist <span style='color:#111;'> 1.24KB </span>","children":null,"spread":false},{"title":"AppDelegate.m <span style='color:#111;'> 16.58KB </span>","children":null,"spread":false},{"title":"Default Images","children":[{"title":"Default-568h@2x.png <span style='color:#111;'> 28.14KB </span>","children":null,"spread":false},{"title":"Default@2x.png <span style='color:#111;'> 23.36KB </span>","children":null,"spread":false},{"title":"Default.png <span style='color:#111;'> 8.12KB </span>","children":null,"spread":false}],"spread":false},{"title":"WebViewController.m <span style='color:#111;'> 22.85KB </span>","children":null,"spread":false},{"title":"CredentialsManager.h <span style='color:#111;'> 3.03KB </span>","children":null,"spread":false},{"title":"WebViewControllerHTML","children":[{"title":"error.html <span style='color:#111;'> 195B </span>","children":null,"spread":false},{"title":"anchorInstall.html <span style='color:#111;'> 954B </span>","children":null,"spread":false},{"title":"spinner.gif <span style='color:#111;'> 3.87KB </span>","children":null,"spread":false},{"title":"root.html <span style='color:#111;'> 506B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"Read Me About CustomHTTPProtocol.txt <span style='color:#111;'> 15.37KB </span>","children":null,"spread":false},{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明