views:

63

answers:

2

Is it possible to restrict access to a server so that only iPhone devices can use it? I have no experience in setting up servers or the like before. I am still very fresh to programming. Thanks.

A: 

Is this a web server you're talking about? If so, then normal web requests have a User-Agent string in the HTTP header. You can check this value to see if the request is coming from an iPhone. If it's not coming from an iphone, you can reject the request, or redirect the user to a page explaining that your website is only for iphones.

nganju
However, note must be taken that this is in no way a secure method -- anyone can access the website if he knows how to fake the user agent field.
Kornel Kisielewicz
A: 

If you are developing the server and iphone software, you could use some form of simple encryption. A model like SSL may be too heavyweight, but it may be an option.

darren