Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main_vm.go: Listen on localhost for dev_appserver; Avoid Mac Firewall #25

Closed
wants to merge 1 commit into from
Closed

Conversation

evanj
Copy link
Contributor

@evanj evanj commented Sep 27, 2016

Without this, the Mac OS X firewall asks if _ah_exe should accept incoming
network connections, since by default it listens on all interfaces. For
development purposes, it is sufficient to only listen on localhost.
This is really annoying when working on Go App Engine projects.

This fix is probably not perfect:

  1. Theoretically, someone might actually want to use dev_appserver to serve App Engine apps on the network.
  2. If the machine doesn't have IPv6, it probably should listen on "127.0.0.1" instead.

I'd be happy to help make both of these changes, if help is wanted.

Without this, the Mac OS X firewall asks if _ah_exe should accept incoming
network connections, since by default it listens on all interfaces. For
development purposes, it is sufficient to only listen on localhost.
@admtnnr admtnnr requested a review from broady January 12, 2017 07:23
@admtnnr
Copy link
Contributor

admtnnr commented Jan 12, 2017

@broady What do you think about this? (Also, how can we manually request the CLA check for a PR? 😁)

@broady
Copy link
Contributor

broady commented Jan 12, 2017

Yeah, I think this is fine. I actually think this fix is perfect - requests actually don't go straight through to the Go binary, they are routed via dev_appserver, which you can change to listen on other network interfaces/IPs via the flags.

As noted, I do think we should always listen on 127.0.0.1 rather than ::1

And 👍 manually verified CLA.

if err := http.ListenAndServe(":"+port, http.HandlerFunc(handleHTTP)); err != nil {
host := ""
if IsDevAppServer() {
host = "[::1]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

127.0.0.1

@evanj
Copy link
Contributor Author

evanj commented Jan 12, 2017

I screwed this up: I think I deleted my original golang/appengine fork on Github, so now this pull request says "wants to merge 1 commit into golang:master from unknown repository" and I don't know how to update it. I rebased and pushed the localhost change requested above to PR #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants