Sending all webpage requests from uiwebview through a proxy server - ios5

I have an app and a server that I am working with. The server acts as a proxy server. In my app, I have a uiwebview which sends a request to the proxy server. The proxy server then generates a response for the uiwebview, sending back the requested page, but the problem is that the uiwebview does not load any of the the resource urls in the page such as style sheets, images etc. through the proxy server.
My question is, is there a way to send a response from the proxy server back to the uiwebview, telling the uiwebview to load all the resources through the proxy server, or is there a way to change all resource url requests made by a uiwebview to point to the proxy?

Have a read up about NSURLProtocol and see if that will meet your requirements to change the url requests to the proxy.

Related

WOPI client and host query

Trying to implement Collabora (CODE) editor on a web app. Currently writing the wopi host code, and I am seeking clarity on one minor detail:
Does wopi client (in my case, CODE) access the file directly from my wopi host using the url passed to it and then send the data to user's browser (in case of which, during updating, the data is posted to wopi client which in turn will post to wopi host? right?), or does accessing and updating the file is done from the user's browser through wopi host url?
This image of a WOPI-Conversation may help. The WOPI server (which is the server where the endpoints are), communicates with the WOPI client. The WOPI client then renders the iframe in the user browser. When saving, the WOPI client will POST the new content to the "PutFile" endpoint on the WOPI server to save it.

How to send permanently a request to my http server

I have a http server running on my pc that I developed using C++.
I need to send permanently a request from the browser to my server (every 1s) in order to refresh my web page's content.
How can I do it?
Thanks for your help :))
This is the kind of thing that AJAX was designed for. Client-side scripting can send requests, such as in a timer, to update specific areas of the page's content without reloading the entire page each time.
Otherwise, look at HTTP server-side pushing to push new data to the client whenever it changes.

iPhone and UIWebView: Force HTTPS (rewrite URLs on the fly)

I have a web based application that uses Cocoa/CocoaTouch's UIWebView. I want (need?) to force all HTTP connections to HTTPS. Note that I am interested in forcing the initial, landing URL to HTTPS and all the intermediate fetches to HTTPS also. Motivation: New Tricks for Defeating SSL in Practice and sslstrip.
Is it possible to configure WebView to only use HTTPS? The UIWebView documentation does not even mention HTTPS. Considering Apple does not allow me to disable JavaScript in a UIWebView, I doubt I can make the configuration change on the view.
Or does the answer lie somewhere in NSURLRequest, NSURLConnection, and possibly delegate methods? I read URL Loading System Overview, and I don't see where I am able to change requests.
If you want to change the request you can proxy UIWebView so all requests are intercepted and then replace http with https, and make the request from the proxy. One way of doing this would be to subclass NSURLCache and override the method cachedResponseForRequest.

iPhone UIWebView intercept HTTP calls to redirect through proxy

I'm trying to hook UIWebView so that when a user enters a url, they are re-directed through our proxy and prompted for authentication.
I'm essentially needing to take the request and add proxy information to the request and pass it over to a UIWebView.
The proxy has to be controlled by the iOS application and not by safari or read from system wide credentials.
I've tried using ASIHTTPRequest to create a request to route through a known proxy with NTLM authentication, that works fine however doesn't bring back css, javascript, images etc.
I then read about and used ASIWebPageRequest however that is currently a bit unstable, doesn't stream and waits for the whole HTML site to download before rendering it to the user.
Can anyone point me in the right direction?
Are you allowed to change the content of the pages so that they point directly to your proxy? That might work.
Personally I'm very curious if there is any other way to do this without rewriting URLs (basically w/ only client side changes). If you found a solution please let me know1

Request builder call not returning when using ssl(https)

I am using GWT. Currently using gwt-rpc to for login authentication. For only login purpose i want to use ssl(https) and so instead of using gwt-rpc i am trying Request Builder and calling a servlet with https.
When in Servlet URL i use protocol as http the request builder works perfectly and response returns to client side(onResponseReceived ). but when i use https in the servlet url then the servlet is gettting called but the response is not returning to the onResponseReceived method of request builder.
my url with http looks like : http://localhost:8888/myproject/myservlet
and with https it looks like :https://localhost/myproject/myservlet
Please give any suggestion or is there any other way to do it.and also is it possible to use ssl over gwt-rpc.
Browser Same origin policy is blocking your requests.
Your page was requested over http, but you are now making an ajax call over https. This is a violation of same origin policy.
To get around, you should serve your original html/servlet over https. This does have a performance cost, but it is the only way to build a secure website.
I'm not familliar with GWT and Request Builder, but whenever I have had problems with HTTPS connections from my code it has come down to certificates and having the right certificate installed in the client or telling the client code where to find the certificate in order to encode the call.
That would be the first avenue I would want to explore in your situation.