google app engine - GAE go only serves paths on localhost not domain -
i messing around small go app google app engine locally using appengine sdk.
i have problem path different root can served if try hit using localhost, not domain name.
my setup follows.
- home.mydomain.com points home ip adress
- my home router forwards incoming tcp , udp on port 80 laptop on port 8080
- my laptop running windows 10
- my go version go1.6 windows/amd64
my app.yaml:
application: tasks version: 1 runtime: go api_version: go1 handlers: - url: /.* script: _go_app
minimum example code:
func init() { filehandler := http.fileserver(http.dir("../frontend")) http.handlefunc("/loggedout", testhandler) http.handle("/", filehandler) log.print(http.listenandserve(":8080", nil)) } func testhandler(res http.responsewriter, req *http.request){ panic("just need work") }
my symptoms if access localhost:8080/ website, , if access localhost:8080/loggedout expected panic.
if access home.mydomain.com/ website, if access home.mydomain.com/loggedout connection hangs, in chromes network tab listed pending indefinitely.
as greg pointed out, when using goapp did not need call listenandserve. goapp listen requests outside of localhost had add --host "my laptops ip" command.
Comments
Post a Comment