aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgogetmebin0 -> 8263248 bytes
-rw-r--r--lib/gogetme.go5
-rw-r--r--main.go6
3 files changed, 7 insertions, 4 deletions
diff --git a/gogetme b/gogetme
new file mode 100755
index 0000000..d07eea9
--- /dev/null
+++ b/gogetme
Binary files differ
diff --git a/lib/gogetme.go b/lib/gogetme.go
index 28b7209..316f792 100644
--- a/lib/gogetme.go
+++ b/lib/gogetme.go
@@ -33,10 +33,9 @@ import (
"github.com/Sirupsen/logrus"
)
-func Serve(customUrl, githubUser, listenPort string) {
+func Serve(customUrl, githubUser, bindAddress, listenPort string) {
// Process inputs
githubUserData := getGithubUserData(githubUser)
- listenPort = ":" + listenPort
// Prepare handler
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
@@ -45,7 +44,7 @@ func Serve(customUrl, githubUser, listenPort string) {
// Listen and SERVE!
logrus.Info("Handling connections")
- err := http.ListenAndServe(listenPort, nil)
+ err := http.ListenAndServe(bindAddress+":"+listenPort, nil)
if err != nil {
logrus.WithError(err).Error("Serving HTTP requests")
}
diff --git a/main.go b/main.go
index c2e7947..827b289 100644
--- a/main.go
+++ b/main.go
@@ -48,6 +48,7 @@ func main() {
// Get ready to GO!
var customUrl string
var githubUser string
+ var bindAddress string
var listenPort string
flag.StringVar(&customUrl, "customUrl", "unset",
@@ -56,6 +57,9 @@ func main() {
flag.StringVar(&githubUser, "githubUser", "unset",
"your GitHub username")
+ flag.StringVar(&bindAddress, "bindAddress", "0.0.0.0",
+ "address to bind to for incoming connections")
+
flag.StringVar(&listenPort, "listenPort", "unset",
"port to listen for connections on")
@@ -66,5 +70,5 @@ func main() {
checkVarPromptUnset(&listenPort, "Port to listen on")
// GOGOGO!
- gogetme.Serve(customUrl, githubUser, listenPort)
+ gogetme.Serve(customUrl, githubUser, bindAddress, listenPort)
}