jeudi 30 juin 2016

Can not access images after convert their address from host to ip address

Here is the situation. On the iOS, I used NSURLProtocol to intercept every single request from the webview. I was trying to intercept requests from a H5 page, so I can get requests of elements in the page, like images, js or css. Then I need to manipulate those links, the purpose is to avoid DNS spoofing.

To do so, I convert image request url format to IP address format. Take Google as example, The logo has address: http://ift.tt/29cApQN. After conversion, I got address start with Google's IP address, http://ift.tt/294oyk3 In the Google's case, it is fine. I can load the image to the browser, however, It doesn't work in some other cases.

Here is another example, http://ift.tt/1VBLwW8. The converted URL is http://ift.tt/294oXTD. Then this I got Direct IP access not allowed. I really think there are so many situations, like whether ports are open or not. Is a way to solve this?




Aucun commentaire:

Enregistrer un commentaire