Google App Engine Laucher extra flags listen to --host 127.0.0.1

245 views
Skip to first unread message

Tasos Kallergis

unread,
Jul 27, 2015, 11:15:40 AM7/27/15
to Google App Engine
Hello, i set --host 127.0.0.1 to listen my application from Google App Engine Laucher extra flags. 
When i try to access from a remote computer to this google app engine application using the local ip of the google app engine computer
i.e(192.168.1.3:8080), the connection could not be happen? When i change the --host to 192.168.1.3, it works.
Why is this happening?

Mars Lan

unread,
Jul 27, 2015, 3:36:57 PM7/27/15
to Google App Engine, tasoska...@gmail.com
The --host flags limits the IP addresses the dev_appserver binds to (https://en.wikipedia.org/wiki/Berkeley_sockets#bind.28.29). Use --host 0.0.0.0 to bind to all available IP addresses on the machine.

Tasos Kallergis

unread,
Jul 28, 2015, 2:18:40 AM7/28/15
to Google App Engine, mar...@google.com
So you say that --host 127.0.0.1 is not available, and may be used from somewhere else?

Anbarasan Gangadaran

unread,
Jul 28, 2015, 3:13:59 AM7/28/15
to google-a...@googlegroups.com, tasoska...@gmail.com
--host 127.0.0.1 - server will listen on the loopback interface and not on the externally accessible interface (network).   i.e. will work only on the host machine, and not from anywhere else.


--host 192.168.1.3 - server will listen on the externally accessible interface with the given address.  It will be accessible when accessed on this remote address.  If the machine multiple network interface, each with different ip, server will be accessible only from the mentioned ip address and not from all the other addresses. 


since you want to access it from another remote machine, you will have to provide the externally accessible address of the machine to the --host flag so appengine can listen on it.  

if the address is mentioned as 0.0.0.0 server will listen on all available addresses on the host, so it can be accessed from either within the host or from external systems.


Regards
Anbarasan


On Tue, Jul 28, 2015 at 11:48 AM, Tasos Kallergis <tasoska...@gmail.com> wrote:
So you say that --host 127.0.0.1 is not available, and may be used from somewhere else?

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/a6f36b10-e94e-4308-bd81-a6156c6712b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mars Lan

unread,
Jul 28, 2015, 1:49:56 PM7/28/15
to Tasos Kallergis, Google App Engine
I'm not sure if I fully understand your question, but 127.0.0.1 is the local loopback interface (https://en.wikipedia.org/wiki/Localhost), so if you want to allow remote connections, you must use either "--host <ip address>" or "--host 0.0.0.0".

Tasos Kallergis

unread,
Jul 29, 2015, 2:35:41 AM7/29/15
to Google App Engine, mar...@google.com
Ok but i thought that 127.0.0.1 is a valid ip address, and can used. I.e if you know Xampp Server when i go to Xampp Computer and change the httpd.conf file to listen to the ip address 127.0.0.1, is not a problem to connect to this Xampp Server from a remote device i.e (Mobile device). When i ask at Xampp forum about the remote connection and the change of the httpd.conf to listen to 127.0.0.1, they told me that 127.0.0.1 is only a so called "loop back" IP and if you want to access that Server from external, any valid external IP (you assign more than one IP to the Server) can be taken.

Tasos Kallergis

unread,
Jul 30, 2015, 6:56:38 AM7/30/15
to Google App Engine
What do they mean that 127.0.0.1 is a valid ip address and can be used

Nick (Cloud Platform Support)

unread,
Jul 31, 2015, 2:48:23 PM7/31/15
to Google App Engine, mar...@google.com, tasoska...@gmail.com
Hey Tasos,

The behaviour of the ip addresses was described quite clearly Anbarasan above. As far as I know, httpd.conf works the same way as well, where 127.0.0.1 is not going to make your server accessible to any other device than localhost. You can read about localhost on wikipedia.

Another clarification to make to your earlier thread is that 192.168.X.X is not an external IP, but is a local area network IP. It seems you are using computers inside your network if you can reach the server which is binding on such a local address. 

One way to get your external (global) IP is to run:

dig +short myip.opendns.com @resolver1.opendns.com

I suggest that you read up on the various meanings of different IP ranges, whether they're local the loopback address, (127.0.0.1/0), local area network (192.168.0.0/16), or public internet.

Once that's done, you should test various options, and if something works, it works. If it doesn't work, think about where the relevant computers are, whether they're on different networks, etc. 

Best wishes,

Nick

Tasos Kallergis

unread,
Aug 1, 2015, 3:28:09 PM8/1/15
to Google App Engine
So Nick you think that when i change from httpd.conf file the ip address to listen to 127.0.0.1, is a valid ip and i may access that service from remote.
I.e now i change this file to listen to ip 127.0.0.1.
I type from another laptop the internal ip of that xampp server that i changed (i.e 192.168.1.4:80), and i normally access to that xampp server.
This is a little weird, but how that happen, because the ip address that xampp server listen is 127.0.0.1.

Nick (Cloud Platform Support)

unread,
Aug 3, 2015, 3:03:26 PM8/3/15
to Google App Engine
Hi Tasos,

I think there may be some issue in language between us, and my apologies in advance if I've misunderstood you, since it seems some negations were added / omitted which would help me to make sense of your reply.

From what I understand about Apache, and remember this isn't an Apache forum, 127.0.0.1 is going to mean that the server will only be accessible from that address, that is from the same server only (127.0.0.1 is the local loopback address).

If you used an internal IP such as 192.168.1.4 to access the server, this means that the client was also within the same network, and you may want to test from a completely external computer. As I said, testing various configurations is the best way to determine the server behaviour. 

It may be possible that Apache reads httpd.conf and uses 127.0.0.1 to listen to any connections, whether machine-local, network-local, or from the wider internet. Either way you'll need to check, and this isn't the right place to ask about Apache server configuration.

As far as the App Engine launcher, have you managed to test the behaviour of the --host flag, and gotten it to work as you desire?

Best wishes,

Nick 

Tasos Kallergis

unread,
Aug 4, 2015, 3:33:05 AM8/4/15
to Google App Engine
Thank you Nick for your answer, i appreciate it.
With Google app engine i have tested the behaviour of host flags, and i think it works fine.
That means that when i set the --host to my computer ip i.e(192.168.1.2) or set the host to (0.0.0.0), i have access to
that google app engine server from remote computer. 127.0.0.1 is for the loop back so it doesn't work from remote.
Reply all
Reply to author
Forward
0 new messages