views:

157

answers:

1

I'm developing an iPhone app that has a network component. I'm developing the app in Java (Google App Engine actually), running on port 8080. And it works, when I test my app in the iPhone simulator.

But now I am trying to test on the device, and I can't hit my Jetty instance. I can certainly access my Mac via the iPhone because I'm able to hit http://10.0.1.7/~brianpapa/ and view my Home Folder when Web Sharing is turned on. But when I try to hit http://10.0.1.7:8080/, it says it can't connect to the server.

Interestingly, if I try to hit http://10.0.1.7:8080/ from my mac, it doesn't work either - I have to use localhost as the hostname instead, then it's fine. Has anybody ever encountered this before, and know how to fix it?

+4  A: 

You need to bind the server to your external ip address. See the docs:

--address=...
The host address to use for the server. You may need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default is localhost.

jholster
Do I have to do this from the command line? I keep trying to edit Run Configurations, click the "Arguments" tab and put the following in Program Arguments: --address=0.0.0.0 But when I run it App Engine doesn't start.
bpapa
I see no reason why wouldn't it work. Try launching the server from command line?
jholster
yeah, it works from the command line. I just haven't gotten it to work via Eclipse itself via Run Configuration.
bpapa
Did you try passing the war location as a second parameter? Just guessing...
jholster