PDA

View Full Version : Connecting to an HTTP/HTTPS Proxy within App - Any ideas if it's even possible?




gwelmarten
Feb 10, 2012, 12:57 PM
Hi
I am looking at building an iPhone App that in some places displays a webView component. I want the content of this webView to pass through some form of a proxy, ideally a HTTP/HTTPS proxy, like the kind you would configure as an auto-HTTP proxy that's stored on a server in a local network (see screenshot below for how I'd configure it on a Mac). This is also the kind that Schools use to filter the internet connection for children. What this is not is a web proxy such as glype or CGIProxy (where a user enters a URL in a form online).

Does anybody have any ideas how I'd go about doing this or any links to relevant pages/Documentation? I've had a look but can't find any. I appreciate this may not even be possible.

Thanks in advance,

Sam



dejo
Feb 10, 2012, 02:18 PM
...(see screenshot below for how I'd configure it on a Mac)...

Screenshot missing.

gwelmarten
Feb 10, 2012, 02:20 PM
Oops sorry - thanks for pointing that out.

Sam

lefooey
Feb 11, 2012, 03:08 PM
There are several examples of apps that display proxied information in a webview. Skyfire is one of the more popular examples.

A couple generalizations of how to implement this are:

Download the content programatically from your proxy source and display it statically in the webview, or
Rewrite the URLs to use your proxy service and only display content that's behind those proxy URLs.


Either of these isn't a simple solution and both require components on both the device and a server.

P.S. The example you've given of a proxy is the built-in network proxy on your mac. That's based on your network connection. The same functionality is on your iPhone under Settings -> WiFi -> (Select network) -> HTTP Proxy (Manual).

gwelmarten
Feb 11, 2012, 03:44 PM
Hi
Thanks for your reply, however I don't think you completely understand what I want to do. I want to make the app connect to an HTTP proxy as the iPhone does in it's settings app, as you describe in your P.S. Is there any way of doing it that way?

Thanks,
Sam

lefooey
Feb 11, 2012, 04:17 PM
Thanks for your reply, however I don't think you completely understand what I want to do. I want to make the app connect to an HTTP proxy as the iPhone does in it's settings app, as you describe in your P.S. Is there any way of doing it that way?

That would be as I describe in option #1. You'd have to implement the SOCKS proxy client code in your app, then use it to download remote content and display that content statically into a web view.

gwelmarten
Feb 11, 2012, 04:20 PM
Hi
Thanks. When I search for this, I get unrelated articles such as ones relating to tethering over SOCKS. Would you give me some technical terms involved here or the names of some relevant methods so I can find appropriate documentation?

Regards,
Sam

lefooey
Feb 11, 2012, 05:06 PM
https://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001132