IPhone Tunnel Web Queries

I want to know if web requests can be tunneled and, of course, what to use / implement.

I have already written subclasses of NSInputStream and NSOutputStream to send and receive data through my own custom proxy server, which works great for socket connections.

I tried to implement the UIWebView and NSURLRequest delegates, but I was not able to capture all the HTTP requests made from UIWebView.

Thanks in advance.

+3
source share
1 answer

You can try using the category to catch all the relevant method calls (template below). However, be careful with dragons and make sure that you decide to use the system proxy before doing this.

UIWebView + PrivateProxy.h

@interface UIWebView (PrivateProxy) 
       - (void)loadRequest:(NSURLRequest *)request;

@end

UIWebView + PrivateProxy.m

@implementation UIWebView (PrivateProxy) 
   - (void)loadRequest:(NSURLRequest *)request {
       if(request.something ....) {
          // handle yourself ...
       } else { 
          [super loadRequest:request]; // use stanadrd implementation
       }
   }
@end

, , , , . , stopLoading ..

0

All Articles