Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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...

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can start the server with address,

dev_appserver.py --address 0.0.0.0 myapp
share|improve this answer
    
I tried doing this, but was still unable to access the server from my office. –  Austin Mueller Jan 7 '13 at 17:22
    
can you try again with your firewall off? –  neo Jan 7 '13 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." –  Austin Mueller Jan 7 '13 at 18:26
    
try other port for net::ERR_UNSAFE_PORT. 8080 is a good one. –  neo Jan 7 '13 at 18:55
    
Turns out the ports weren't forwarded properly on my router, also running on port 8080 made chrome happy –  Austin Mueller Jan 8 '13 at 5:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.