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

Discussion in 'iPhone/iPad Programming' started by gwelmarten, Feb 10, 2012.

  1. macrumors 6502

    Joined:
    Jan 17, 2011
    Messages:
    477
    Location:
    England!
    #1
    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
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Messages:
    15,045
    Location:
    The Centennial State
    #2
    Screenshot missing.
     
  3. macrumors 6502

    Joined:
    Jan 17, 2011
    Messages:
    477
    Location:
    England!
    #3
    Oops sorry - thanks for pointing that out.

    Sam
     

    Attached Files:

  4. macrumors member

    Joined:
    Dec 26, 2009
    Messages:
    64
    Location:
    Spokane, WA
    #4
    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:
    1. Download the content programatically from your proxy source and display it statically in the webview, or
    2. 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).
     
  5. macrumors 6502

    Joined:
    Jan 17, 2011
    Messages:
    477
    Location:
    England!
    #5
    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
     
  6. macrumors member

    Joined:
    Dec 26, 2009
    Messages:
    64
    Location:
    Spokane, WA
    #6
    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.
     
  7. macrumors 6502

    Joined:
    Jan 17, 2011
    Messages:
    477
    Location:
    England!
    #7
    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
     
  8. macrumors member

    Joined:
    Dec 26, 2009
    Messages:
    64
    Location:
    Spokane, WA

Share This Page