Can't reach local GAE server through my ip - google-app-engine

I developing an app with GAE as a back-end, when I run GAE server locally I can reach it in the browser through localhost:8888 but when I try to reach from an external device on the same wifi network, with my <my local ip>:8888 I get no response. I was always using this way do debug my apps and back-ends and suddenly it stopped working?

Found the answer at last, add 0.0.0.0 address to the servers run arguments. As described here :
Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX
https://developers.google.com/appengine/docs/java/tools/devserver#Using_URL_Fetch

Related

intermediate hops in nginx reverse proxy

I am new to nginx and doing full stack development for the first time. Could you please help me understand the below logic
Lets say we are building a chatting app. We have 3 servers (EC2 instances)
server_nginx - ec2 running a nginx server working as reverse proxy
server_react - ec2 running a react project through nginx as web server
server_spring - ec2 running a spring boot project through nginx as web server
My reverse proxy is running through SSL/https. Initially everything was happening on same machine, so I made my spring boot service also ssl because I could not initiate a http connection over https. Now the I started separating out the instance as mentioned above (3 ec2 instances). I was expecting that the connection to my backend would fail. Reason :
user connects to reverse proxy through https domain (lets say mydomain.com).
The request comes to server_nginx(mydomain.com).
From here this proxies this to server_react (which is running on simple http). This is the server where my react code is hosted
This react code tries to initiate a web socket connection to server_spring where I have enabled the CORS for mydomain.com. So I was expecting that the connection would fail here as this is a different IP now. But surprisingly all the apis are getting the response as if I am hitting it from mydomain.com
So can anyone please help me understand why is the behaviour like this
Thanks.

What is the equivalent of a hosts file mapping for AppEngine?

Our AppEngine app is connecting to a remote service which requires a VPN and also required me to add entries to the hosts file on my local machine in order to connect to their endpoints.
e.g.
10.200.30.150 foo.bar.com
This is working fine when running the app locally, but I can't figure out how to set this up on Google Cloud to work once deployed.
I can't use the IP addresses directly because it errors that the IP is not on the cert's list.
How do I map the host names to the IPs in Google Cloud so that AppEngine can use them?
From the error mentioned in the comment I suspect connecting directly through the IP fails because the certificate doesn't recognize the IP to DNS mapping as valid and therefore the secure connection setup breaks. Based on the requirements of connecting to the API by VPN and tweaking the hosts mapping there are few things you may try.
The simplest approach that may work would be using a Google Compute Engine VM instance, since there you would able to manipulate the etc/hosts file and replicate the local machine setup. This VM could be used either as the main app service or as a proxy from App Engine to the 3rd party API endpoint. To go that route I would suggest taking a look at these two posts which explain how to change the etc/hosts file on GCE (Changing the file once wouldn't work as the VM periodically overrides it, see the posts for cronjob like workaround).
Separately, as your app runs in App Engine flexible environment there is the chance to provide a docker container with the app packaged. It may be possible to set the workaround above in the docker file and have it working in App Engine too.

Localhost and Ionic View

I am testing in my browser using Ionic Serve and I am also connecting to a RESTful WCF Service running on a Localhost. I want to be able to connect to that service using the Ionic View App. Is it possible to connect to a local host with an external device like using Ionic view app on my device or do I need to host my service differently?
computer and device on same network
goto computer command prompt and run this command ipconfig
you will get internet ip address like e.g:192.168.0.102
now move to your device set http:// 192.168.0.102:yourapilink?parameters=1
please like if answer really helpfull
There are tools available, but most easy way will be this:
Make sure both computer and mobile are on same network.
Run server on localhost, and in client side code replace localhost with the IP address of your system where you are making api calls. For example localhost/api/login with 192.168.1.102/api/login.
Now your mobile will be getting response from server running on your system.

Open with redirect to localhost oauth2callback

I support Google Drive SDK 'Open with' at my Go AppEngine based app. Everything works fine for my deployed app. But I cannot setup a valid local AppEngine development setup.
The local AppEngine server runs on http://localhost:8080, therefore my callback for the 'Open with' (Authentication is on) is http://localhost:8080/oauth2callback. But this is not a valid 'Open URL' at the Drive SDK settings (console.developers.google.com). So what's the right setup? Is it not possible to develop 'Open with' functionality with a local AppEngine dev environment?
Jens
Jens,
It's possible to work with OAuth locally but it requires some work, consider that "localhost" means something different for every computer, and that's why it's valid only in a local context. That's why the console does not allow that value.
If you really need to get that callback on your local server you'll need to make your PC's "address" unique and globally accessible, meaning you'll probably have to setup a static IP or Dyniamic DNS and redirect that to your PC so the OAuth provider has a fixed address to locate your PC.
Just edit your /etc/hosts (or windows equivalent) file. Find the line that says
127.0.0.1 localhost
and add (say) mydevserver.me.com
127.0.0.1 localhost mydevserver.me.com
You can then configure mydevsserver.me.com in the Google API Console.

How to connect heroku app with openshift app database

I am having app on Heroku and of course on Openshift
Now, I would like to use a common database for them. So, how should I connect Heroku app with the Open Shift app database??
OpenShift blocks all incoming ports EXCEPT 80, 443, and 22.
Like the answer above you will either need to set up a SSH tunnel with port forwarding between your two server (which seems VERY fragile to me)
OR
You can set up a web service on your openshift server to handle all the DB requests. This is what happens when you use something like mongolabs or fusiotables with heroku. The difference here is that you would need to write your own web service to expose the database.
You can use port forwarding for this kind of work,Try these article http://bitsofinfo.wordpress.com/2012/06/05/how-to-access-your-openshift-mongodb-database-remotely-on-os-x/ or,
Otherwise you can use a piece of software which runs on your openshift server,which remotely execute your commands on database.For that try Google and note that The ports 0 to 18000 are blocked to incoming traffic.

Resources