0

I am trying to run a web server with Go and Google App Engine. The server is an Ubuntu server, and i have successfully installed both Go and Google Appengine. I can use the server i created locally... however, I want to be able to use it outside just my local network, from my office for example. Is there anyway to set this up? Rather than run the server on localhost:6000, I want to be able to connect to it externally via XXX.XXX.XXX.XXX:6000. I have opened ports 6000-6999 on my router.

Just incase anyone wants to see it, my server code is here, and is very simple.

package main

import (
        "fmt"
        "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "Hello world.")
}

func init() {
        http.HandleFunc("/", handler)
}

Thanks in advance...

1 Answer 1

0

You can start the server with address,

dev_appserver.py --address 0.0.0.0 myapp
5
  • I tried doing this, but was still unable to access the server from my office. Jan 7, 2013 at 17:22
  • can you try again with your firewall off?
    – neo
    Jan 7, 2013 at 17:39
  • I ran "sudo ufw disable" then "dev_appserver.py --port=6000 --address=0.0.0.0 myapp/" Curl gives me this curl: (7) couldn't connect to host and Chrome gives me "This webpage is not available - Error 312 (net::ERR_UNSAFE_PORT): Unknown error." Jan 7, 2013 at 18:26
  • try other port for net::ERR_UNSAFE_PORT. 8080 is a good one.
    – neo
    Jan 7, 2013 at 18:55
  • Turns out the ports weren't forwarded properly on my router, also running on port 8080 made chrome happy Jan 8, 2013 at 5:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .