2 Replies
      Latest reply: Nov 10, 2016 11:54 PM by tej13 RSS
      tej13 Level 1 Level 1 (0 points)

        All the requests made by my app must pass through a proxy. I am able to do that for a request made by NSUrlSession using the API's

        (ex : configuration.connectionProxyDictionary = proxyDict;)

        How do I achieve the same for a request made by a webview( [self.webView loadRequest:request];)

         

        Thanks!!

        • Re: How to attach proxy for a webview?
          eskimo Apple Staff Apple Staff (6,675 points)

          There isn’t a good way to do this.  For UIWebView you can use an NSURLProtocol (as illustrated by the CustomHTTPProtocol sample code) but it’s a bunch of work and has a lot of sharp edge cases.

          For WKWebView, which is what we recommend that folks use, the networking is done out of process and thus the NSURLProtocol technique does not work.

          Regardless of what else you do here, you should file an enhancement request for direct support for this in WKWebView.  Please post your bug number, just for the record.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          • Re: How to attach proxy for a webview?
            tej13 Level 1 Level 1 (0 points)

            Okay Eskimo, Will do that