Google Earth API doesn't load map on localhost - google-earth

I am able to load KML into Google Maps despite what this answer says, but my problem is that there is no data coming in from Google's servers. All I get is a blurry map from the default texture that comes with the Google Earth plugin. Uploading the same html file to a public web server works.
Google is probably sending the window.location and checking if it can visit the URL from their end - if not then it denies any access to map data. This is to prevent people deploying apps locally (e.g. intranets) and not buying a license. I want to be able to develop locally, and this is restricting that ability.

I had the same problem, what helped me was to open the server's HTTP port on my router (and if you have a firewall you need to open the port there as well).

Related

How does iTether work (html5 iphone api)

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.

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.

Is it possible to connect from a remote browser to my CocoaHttpServer?

I've been trying to find a solution to run an http server on an iOS device, which is accessible from anywhere as long as the encompassing app is open and running.
While searching for solutions I've come across several libraries, one of which is Cocoahttpserver https://github.com/robbiehanson/CocoaHTTPServer
While I see many people use this for setting up a local httpserver and accessing it from the same app, I am not sure if this can be accessed from a remote browser--for example my desktop browser. So here are my questions:
Is this possible? (running an iOS web server which can be accessed from anywhere, not just local network)
If it is possible, is it possible to set a static domain that will redirect to my iOS server?
1) Yes, it can be achieved. Either use the CocoaHTTPServer, which is a great library - or you can look at some tutorials on the net, like this one http://www.cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html
2) Unfortunately no, because the devices will have different IP depending on the internet connection, and the domain name can be only used with one defined IP address. You could also use the Bonjour name, however it would be probably easier to use the IP address.

iOS Device communication

I am keen to get some apps built that can communicate with other devices/ web etc. i have played around with FTP and can get so far. But what is the best way to do this? We don't have any Servers with databases etc, but do have a site that we are currently uploading and downloading files to.
can anyone suggest a good/ better way to get the device to send/ receive files?
thanks
sam
If it's HTTP communication you're wanting to do, the simplest and most powerful tool is ASIHTTPRequest.
HTTP is the protocol your web browser uses to talk to web servers. If you have a site you're storing and downloading files at, it's almost certainly HTTP you're talking to it.
For iOS device to device communication one can use Bump API.
EDIT: I don't know of a generic framework for device <-> server communications, but having built applications that use web services of other providers like Yelp, Yahoo, Google Maps, I would say the way to go for this is to have REST based web services which exchange data in JSON format.

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.