-
Notifications
You must be signed in to change notification settings - Fork 60
DevAppServer wrong host for /_ah/api/static/proxy.html #240
Comments
@loosebazooka can we get a release bump please? |
@loosebazooka should we file this as a bug under Cloud Tools for AS? On Wed, Mar 30, 2016 at 5:15 AM, William Crandell notifications@github.com
|
we can file a bug to change the template to set it to 0.0.0.0 or at least add a comment there? |
@CrandellWS while this is not really related to dev appserver override, you should be able to edit your build.gradle file and set the httpPort in the appengine closure there. |
@loosebazooka setting the value to 0.0.0.0 is how I can find the problem but does not fix it. Or am I misunderstanding? |
When using 0.0.0.0 everything works when using a browser on the same machine, regaurdless of browsing to localhost or 10.0.0.10 (as example) but using a different machine or device that CAN NOT access the devappserver using localhost in the browser address bar and can only access with ip 10.0.0.10. I end up with 404 errors trying to access localhost on the remote machine that is not running the appserver. let me know if I can clarify or if you want me to make a demo. I made a gist based on the tutorial in the discription: as there is no live app I changed the build config is :
|
by the way the port does not change only the host and I was wrong it is not a 404 error rather a connection refused because there is not a server running on the external machine... http://localhost:8081/_ah/api/static/proxy.html?jsh=... and I am actually using port 8081 for this.... |
@loosebazooka You see the error when you click the 'Say "Hello" >>' button but not before |
I'm not sure I understand, are you trying to access 10.0.0.10 appears to be the address of your computer running the appengine application? In which case it should make sense that that's the only way to access it. The javascript code you're referencing is some special code to detect that you're running the server locally and disable https. Keep in mind that if you're deploying this to app engine (on the cloud), you will need it to be an https address. So, I guess it makes sense that you can only access it by 10.0.0.10. If you use 10.0.0.10, what breaks? |
the problem is the DevAppServer is sending a link for localhost from 10.0.0.10 that should be 10.0.0.10 and not localhost. So: Should be: but it is not, hence the problem is only apparent when accessing through a different machine/device/pc whatever... |
oh interesting, can you set the httpAddress on the devAppServer to 10.0.0.10 and then launch? I wonder if it's something to do with the endpoints configuration. |
same results |
hence my assumption that might fix this issue |
you seem to have your javascript loading stuff in two places : is everything updated correctly here? On Wed, Mar 30, 2016 at 7:44 PM, William Crandell notifications@github.com
|
yea I had separated the javascript...but for this I put it back and forgot to delete the js file...I updated the gist to clarify |
You are correct that DEV_APPSERVER_DEFAULT_ADDRESS does not fix this, as I had hoped... @loosebazooka if I can help further let me know, as in the future I will be wanting to test in this manner (using remote devices instead of emulators). Thank you for your time and help. I will check back into this at a later unknown date and time. |
Everything I understand about the problem makes it seem like it should work. I'll set up a test and update the bug when I can. |
@loosebazooka it would be nice to have another clearly reproduce this, thanks, the easiest way to reproduce this I know, would be to use "Android Studios" set up a project and add a "Google Cloud Module" after you add or import the new module, all you will need to do is adjust the build.config and run it.
and
Readers please remember to also set the IP and port information as is described elsewhere in this thread. |
see google/google-api-javascript-client#175
As suggested at: https://cloud.google.com/appengine/docs/java/tools/devserver#Command_Line_Arguments
https://cloud.google.com/tools/android-studio/app_engine/run_test_deploy
When attempting to run the sample running the DevAppServer using Android Studio on pc and accessing via external device, "Chrome://inspect" shows an error connection refused because the usl points to localhost and it should be pointed to the host ip not the client.
This error is only found when the host and client have different localhosts (ie they are different machines).
tried answer at http://stackoverflow.com/a/33316693/1815624 but to no avail, though setting the ip to 0.0.0.0 might help track this:
If I set the ip to the machine's network ip instead of 0.0.0.0 I get different 404 errors than if it was set to localhost.
The text was updated successfully, but these errors were encountered: