How does iTether work (html5 iphone api) - iphone

How does something like itether work? Is there an HTML5 api that gives you this level of access to the device? I would assume giving a web based app this much access is a huge security risk.

Tethering's HTML5 app works by by using the iPhone as a proxy server,
so one sets up an ad-hoc Wi-Fi network and runs special desktop software
to direct HTTP traffic to the iPhone.
The HTML5 page loaded onto the iPhone pushes the traffic on and
returns the result, creating tethering without having to get approval
from Apple, or the network operator. ( Original Source )
I think they are using HTML WebSockets detects the presence of a proxy server and automatically sets up a tunnel to pass through the proxy.

Related

Web API and Native API compatibility

Ok. Here is my situation:
I am developing an embedded device, which provide a service. It will provide some web based services to a client (a smart phone).
Currently we are planning to implement a REST server in the device so that web applications can easily access and use the services provided by the device.
In the future, we plan to add a display and a better processor to our embedded device so that we can run the web applications on the device itself.
We want to maintain application compatibility - i.e all the current web applications should work on the device without any modifications.
Is there a better way to implement this than using REST and HTTP? I am worried about performance running both the server and the client on the device.
If you take care to separate the REST Api code from the actual service code, your newer device can interface (direct call) directly with the service instead of wrapping everything into HTTP and REST.
This being said, you can always try an implementation using you REST api and validate if performance is adequate. If it is, you do not even need to add the indirection.

How can I test an iOS App I am creating and simulate a Chinese user?

I am developing an app that will be used world-wide and have a co-worker who lives in China. He claims it takes a very long time to reach our server here in the US and I want to be able to use the app on my phone but through a VPN and proxy on my iPhone so it appears that I am in China. Is that possible?
Here you can find a list of Chinese web proxies.
You should also change your app so that it goes to through the proxy. This depends on how you are dealing with HTTP communication but if you google it, you will find many posts.
Keep in mind that a proxy will add a further delay in communication.
If you want to setup a VPN, have a look at this tutorial for setting up a VPN on your Mac and then connect the iPhone to it.

Prevent from specific app using internet connection

I have a client claims that my app can't connect to internet despite of he has WiFi connection and Safari application, for example, works fine. Is there any way to setup for specific app NOT to connect to the internet? I use in my app simple ASIHTTTPRequest library to make a connections. Maybe it influenced by jailbroken device? Regards!
No, there is no way to do this in via an iOS setting.
However I've had a problem like this with a client, where to Webservice the app connecting to was blocked by there firewall/proxy.
Later the black was lifted but all calls to the webservice where is cached by the proxy give really weird results.

How to access remote connection requests from safari, facebook and other applications on iPhone

I noticed one application on app store recently named onavo which access internet connection usage from other applications on iPhone like safari, facebook, youtube, etc. Is there any API available for this. How they have implemented it. Curious to know about it.
I've found the answer on Quora. As follow:
http://www.quora.com/How-is-Onavo-able-to-direct-all-the-data-traffic-to-their-proxy-without-using-iOS-private-APIs
Roi Tiger, CTO of Onavo
Hi, I'm the CTO of Onavo, thank you for checking out our service. After installing Onavo you are prompted to install a configuration profile which allows the data to be redirected through Onavo's servers using a proxy server settings.
Configuration profile installation does not require any private API access in the iOS platform.
Another answer:
http://www.quora.com/How-does-Onavo-manage-to-compress-data-traffic
They're not monitoring the apps’ data usage on the phone itself. It looks like Onavo sets up a proxy on the phone (probably via a configuration profile) so that your data traffic goes through their servers, so monitoring which sites that traffic is going through is trivial on their end. From their privacy policy (emphasis mine):
Onavo provides services for reducing data usage of certain mobile phones. To benefit from the Services, your access to the Internet through your mobile phone will be routed through Onavo's servers, which strive to reduce the volume of your downloads, and potentially your uploads as well.

Secure iPhone-Desktop Connection

Background
There are a lot of App Store released iPhone apps that require an IP based server on the desktop so that the iPhone can connect to the desktop as a client. For example, there are many programs that emulate a keyboard, touchpad, or Apple remote on the iPhone so that a desktop computer can be controlled over wifi. However, many of these applications get around writing their own server by requiring the user to install some VNC server variant.
Question
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Sample Use Case
An event on the desktop causes the desktop to push a small image or text to the iPhone. An event on the iPhone causes a short text message to be pushed to the desktop. Any single event can happen at any time (doesn't appear synchronized to the user).
1st Follow-Up Question
Would this type of project be best handled using something like XML or JSON over HTTP? Or is there a better protocol, like BEEP or Bonjour(XMPP)?
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Not sure if there is a "best" way, but much code is already available to do xyz-over-HTTPS (TLS/SSL). In that case, the "xyz" can be any web-based message exchange protocol, such as XML, JSON, etc. via REST or SOAP, etc.
If you want to be able to push events to a non-jailbroken iPhone you can't do it other than via Apple's Push Server which causes a notification to the client program if it is running or otherwise displays an alert of some kind to the user.
Typical architecture has those notifications handled by the client program as an indication it should go and get some data from the server - Apple insist we do not regard the notifications as trusted delivery.
I suggest a read of this article on using Bonjour and local networking, whilst it's iPhone to iPhone it should apply to desktop OS/X also.