Add support for configurable binding address

This commit is contained in:
Anthony Accioly
2024-10-18 23:49:38 +01:00
parent f56b389948
commit e179dedd78
3 changed files with 19 additions and 7 deletions

View File

@@ -48,8 +48,10 @@ func main() {
http.HandleFunc("/", dynamicRelayHandler)
log.Printf("🔗 listening at http://localhost:3355")
http.ListenAndServe("0.0.0.0:3355", nil)
addr := fmt.Sprintf("%s:%d", config.RelayBindAddress, config.RelayPort)
log.Printf("🔗 listening at %s", addr)
http.ListenAndServe(addr, nil)
}
func dynamicRelayHandler(w http.ResponseWriter, r *http.Request) {