I’m creating a web-browser type app (using a web view object) that needs to be able to connect to the internet via a proxy. Server, port, username and password can all be hardcoded into the app but unfortunately I have no idea how to customise the proxy settings of a web view without changing the system wide proxy settings.
If you know how to do this please provide some example code, thanks a lot!
(Also, if it changes anything – I’m developing for mac, not iPhone)
The easiest way I know is to wire up a UIWebView delegate and listen to all requests before they go through, and redirect the ones you care about through ASIHttpRequest and your custom proxy settings.
It’s a bit wonky,but it should work. Just remember to manage your memory properly and don’t use this leaky example code… YMMV, I haven’t even tested if this compiles, typed it all in the browser window with some copy and paste hackery.