diff options
| -rw-r--r-- | main.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -5,6 +5,7 @@ import ( "net/http" "io" "flag" + "fmt" ) var rawBody = false @@ -46,8 +47,9 @@ func handle(w http.ResponseWriter, r *http.Request) { func main() { b := flag.Bool("b", false, "Read raw body") + p := flag.Int("p", 8080, "Port to use") flag.Parse() rawBody = *b http.HandleFunc("/", handle) - log.Fatal(http.ListenAndServe(":8080", nil)) + log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *p), nil)) } |
