How iTeleport works? - iphone

can someone explain me how this app works? I mean, is not about how to use it, is about how they transmit information from the computer to the mobile device, I just need general terms.

They run a VNC server on the computer and set up port forwarding using UPnP.

They're using a remote desktop protocol (VNC) to transmit the image on the screen over the internet to the client device. Individual actions (like mouse clicks) performed on the client device (e.g. an iPad) are sent over the internet back to the computer, where the RDP server emulates the action.
In order to bypass issues like NAT, they either use UPnP (automatic port forwarding) or have an intermediate server somewhere that both the client device and computer connect to.

Related

how to access client desktop and to control mouse using tcp/ip protocol from server machine

I'm working on project to develop an software using the TCP/IP protocol. The basic function of the software is to access the client activity running on client machine from server machine, for example information about current running applications.
Also, I want to access desktop screen and mouse from client machine to server machine using TCP/IP protocol. What are the basic steps that I can follow to access the desktop and could handle client mouse from server machine using TCP/IP.
It sounds like you want to build a VNC or RDP -like program. There have been an explosion of these services/programs in the time since you asked the question, though I don't know how many might be open source. I would start by investigating an Open Source VNC client and then see about adding an encrypted tunnel to keep the connection secure.
UltraVNC and TightVNC are popular Open Source VNC clients.

How to set up http server on iPhone behind firewall

I want to develop an iPhone app with a simple IM feature. I am thinking about setting up an HTTP server on an iPhone. If the iPhone is using wifi and is behind a firewall, how can I make sure that other iPhone clients can connect to it?
It's not the firewall that will disturb the connection as much it is the NAT.
When you are connected through wireless router to connect the internet you are surfing via NAT. it means you dont really have an extenral IP but once you initiate connection the router will map your intenral IP to one of his externatl ports and for certain time window he will pass connections to you if he will get it to the right port.
That being said, there is no actual way of setting a server behind a NAT unless you can configure port forwarding in the router and internal static IP.
Hope i was clear enough, good luck
I do not really think that you need to get an HTPP server up and running on iPhone to make an application that can send and receive messages (IM). The idea of making one iPhone user to directly connect to one another does not seem right to me since the users will need to know IP addresses of one another to do that.
Interconnectivity between different users of the chat can be solved by making your application communicate via a dedicated TCP port. It is generally advisable to choose ports with a number higher than 1024 since those below are generally found on the list of so-called well-known ports and are used for Web (like port 80), FTP (port 21), SSH (22), DNS (53), etc., it will be the responsibility of the user to make sure the port used by your application is open on the firewall. In order to solve this problem you can actually use port 80 for communication if you find that the port you have selected is blocked. You can do this because you know that this port will not be blocked in most cases. Indeed Yahoo Messenger is reported to use this technique when the firewall blocks the port it uses for communication.
The port should be used by your application to connect to the Web-server that will actually store user credentials, perform authentication, message transmission, etc., and the server should reside on capable hardware to be able to support large number of simultaneous connections. I can suggest using either a VPS (like the one provided by Linode) or a cloud (like Amazon EC2, Google Application Engine, Rackspace).

Connect to attached pc from WP7 by opening a socket to localhost

When developing and testing WP7 apps you're pc is connected to either a real WP7 phone or to the WP7 Device Emulator. For a specific development-purpose I would like to connect directly to the development pc (let's call it the host pc) from the WP7 app without having to rely on an external toast-server. I'm using plain sockets, System.Net.Sockets.Socket.
There seem to be two options:
Obtain the host pc's LAN IP and connect to that
Connect to localhost
Option 1 usually works well, but not always: The host pc may not necessaily have an IP, in which case there's nothing to connect to. Also, in some scenarios all LAN traffic is directed through a company-wide proxy which will disrupt this mechanism.
That lead me to try out option 2. To my surprise it seems to work, but I need to be more sure than simply "it seems to work". I've googled all over but can't find any definitive answer, not even on Microsoft's site like e.g. http://msdn.microsoft.com/en-us/library/ff754351(v=VS.92).aspx. So this is my question:
What exactly is the defined behavior of connecting to localhost from a WP7 app?
Altrernatively, is there a fool-proof way of connecting back to the host-pc?
(Let me stress this again: For this particular purpose I can't use toasts, because the development pc may not even be online.)
Edit:
I work at EQATEC and the application in question is the EQATEC Profiler. Right now the profiler/app-communication is handled by injecting a socket/http-client into the deployed WP7 app that connects back to the profiler's LAN IP address. It works very well and is really fast, but in some very rare cases users are offline and therefore doesn't have an IP, or have some prohibitive lan proxy rules.
Therefore connecting to "localhost" would be excellent if that somehow magically would always work for everybody. It works for me and a couple of test-users, but does it work for all our many thousand profiler users all over the world? I'd like to be more sure.
"localhost" by definition is the machine running the code (well specifically the NIC doing the communication). For either the Phone or the Emulator, that would mean the phone or the emulator, not the PC they are attached to.
When you attach to a PC, you do have a network - it's an RNDIS connection in which both sides get an IP address which traditionally (pre-WP7) could be resolved with 'ppp-peer', though I've not tested that resolution on the Phone. I suspect it will be the same, since WMDC is still what's connecting and they'd have little reason to change that connection mechanism.
If the emulator is resolving localhost to the PC on which is resides, that's a definite bug and I would not count on it continuing to work as they add more robust socket support to the Phone platform.
System.Net.Sockets.Socket isn't really currently available for WP7 programming, but it might be available at some future point (maybe in Mango... maybe...)
AFAIK, the only way to reliably do what you want to do is to set up an http server on the development PC and to provide your app with an HTTP address of that server - or to route messages via some "Cloud proxy"
I'm surprised localhost works at all on the real device... I can only assume that they are asking the connected PC to resolve that DNS name - but even then I'm surprised 127.0.0.1 works.
The ip you're looking for is "192.168.55.100"
That's the ip address the phone uses to connect to the host pc.
If you'd like to connect to the phone, apparently its ip address will be "192.168.55.101"
For the emulator just use localhost or 127.0.0.1
This is from the old ActiveSync days, so I don't know how official it is or how likely it is to last, but for right now at least it worked on my phone.

objective-c : iphone programming wirelessly lock computer from iphone

i am doing an application in which i need to lock,turn off the computer wirelessly.
It is possible?
Yes, but you'll have to write two programs:
The iPhone app that sends the lock command to the computer (over the network)
A program running on the computer that listens on the network for commands and locks the computer when it gets them
It's possible. For example, you could run a daemon on your computer that listens for a command to lock or shutdown, and your iPhone app can connect to the computer and issue the appropriate command. Of course, you have some considerations such as firewalls, NAT, and security issues to deal with.
To bypass some of the problems Jeff mentioned, you need to build a service that brokers communication between the iPhone app and the machine.
The program running on the machine needs to talk to this service over HTTP/S (so no NAT/Firewall problems), and keep polling (see long-polling). The iPhone app sends the server information when it wants to shut down the computer. The server sends an appropriate response in such a case to the long-poll, at which time the client software on the computer turns it off.
So yes, to do this right you need a stateful server.
Good luck.
Airlock does something similar for the iPhone/Mac via a System Preferences plugin and bluetooth (but no app on the actual phone).

Capturing network traffic while the application is running on iPhone and connected to xcode

Is there any way I can capture network traffic (using application like Ethereal, on Mac ) while the application is running on iPhone and connected to xcode
Thanks
Connect you mac using an ethernet cable. Share your network connection on the mac over your AirPort. Attach the iPhone to your Mac's ad-hoc network.
Run Wireshark or HTTPScoop on your mac and you will be able to see all traffic from the iPhone.
I'm no aware of any way to do this for the WAN connection though. I'd be surprised if it is possible.
To capture packets from your iPhone using Wireshark, you have to first get your device id for the phone from iTunes. Plug in your iPhone via USB to your Mac...then open iTunes and click the iPhone icon in top navbar.
You can't copy the UUID, so you have to write it down manually. After you have the UUID, you'll need to mount the device.
Open a terminal and type: rvictl -s <device-id>
I created an alias in ~/.bash_aliases as alias mntios='rvictl -s <device-id>' -- as long as you have the same phone your device UUID won't change, even if you re-install the OS.
Once you have the device mounted startup wireshark. brew install wireshark (see: http://brew.sh)
One of the network adaptors should be rvi0 -- this is the network interface for your iPhone.
Now you can capture packets -- double click it to start capturing.
If you want to filter for specific urls you can type a filter like: http.request.full_uri contains <string-in-url> to filter requests.
On your computer, run an HTTP debugging proxy like Charles (Mac) or Fiddler2 (Windows). In the phone's wi-fi settings, turn on the HTTP proxy, entering your computer's IP address and the port number of the proxy. Make the sure the proxy is configured to allow connections from your phone. (It may allow localhost-only by default.)