Skip to content

Commit 4d2bbf8

Browse files
committed
fix(listening port): listening can be disabled with --port=0
Signed-off-by: Szilard Parrag <[email protected]>
1 parent b6483a5 commit 4d2bbf8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ func main() {
110110
}
111111

112112
events.Add(events.OnStart())
113-
info.Printf("listening on port:%v\n", *port)
114-
info.Println(http.ListenAndServe(fmt.Sprintf(":%v", *port), httpApi))
113+
if *port != 0 {
114+
info.Printf("listening on port:%v\n", *port)
115+
info.Println(http.ListenAndServe(fmt.Sprintf(":%v", *port), httpApi))
116+
} else {
117+
info.Printf("listening port disabled\n")
118+
}
115119
}

0 commit comments

Comments
 (0)