mirror of
https://github.com/yunginnanet/HellPot
synced 2024-06-25 15:28:01 +00:00
Try getting port from ENV
This commit is contained in:
parent
9642ad4af2
commit
186d672aa2
@ -23,13 +23,16 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, usage)
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
|
||||
addr := flag.String("addr", "127.0.0.1:8080", "Network address to listen on")
|
||||
path := flag.String("path", "/", `Path to serve from. Path ending in / serves sub-paths.`)
|
||||
flag.Parse()
|
||||
|
||||
http.HandleFunc(*path, heff.DefaultHoneypot)
|
||||
|
||||
log.Fatal(http.ListenAndServe(*addr, nil))
|
||||
log.Fatal(http.ListenAndServe(":"+port, nil))
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user