Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么不用 NSURLProtocol 来做原始网络拦截? #2

Open
tigerzhang08 opened this issue Feb 5, 2018 · 1 comment
Open

Comments

@tigerzhang08
Copy link

No description provided.

@aozhimin
Copy link
Owner

aozhimin commented Feb 5, 2018

@tigerZhang86 是的,确实可以用 NSURLProtocol 可以做网络请求的拦截,而且确实也有项目是这么做的,比如 NetworkEye ,但是我们这边做的网络监控需要实现更加细致化和定制化的需求,比如 NSURLSessionUploadTaskNSURLSessionDownloadTask,而且 UIWebView 的网络请求也必须使用 NSURLProtocol 来做拦截,所以目前我们是采用 NSURLSession 的 Hook 和 NSURLProtocol 混合的方式来实现的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants