Home > database >  How to hide ios app IP address from third party servers?
How to hide ios app IP address from third party servers?

Time:02-10

My ios app retrieves some data from third party servers during runetime. For privacy reasons, I want to hide the IP addresses of my users, in order to prevent those servers to know them. How can I do that ?

My idea is to set up a kind of "proxy server" or "VPN server" inbetween the app and the third party servers. Is that a good idea ?

Thanks for your help!

CodePudding user response:

Yes, proxying is the right way to do this. You could do it with a VPN, but that's overkill, and requires considerable setup on the client side which you don't control.

You can get a web server such as Nginx or Apache to act as a proxy directly through config options, or you can do it via scripting with PHP or whatever. I do the latter to provide a proxied service to gravatar.com. The principle is quite straightforward:

  1. Accept a request from your client.
  2. On your server side, make a request (using an HTTP library, such as Guzzle) to the 3rd party service to get whatever is needed.
  3. Parse the response from there and create a response suitable for your client.

This way the 3rd party service will only ever see the IP of your server, not your client, and you can choose exactly what data from the client you pass through. In my gravatar example, it sends an MD5 hash of the user's email address, which has its own privacy implications, but that's a separate problem!

  • Related