Open with or without TLS depending on which environment we are on.
This commit is contained in:
parent
2803b41186
commit
bfc9d247be
20
main.go
20
main.go
@ -18,19 +18,21 @@ func main() {
|
||||
log.Println(err)
|
||||
}
|
||||
|
||||
log.Println(hostname)
|
||||
|
||||
http.HandleFunc("/", server.SocketHandler)
|
||||
|
||||
log.Println("Cert file: ", cert_file)
|
||||
log.Println("Key file: ", key_file)
|
||||
|
||||
err = http.ListenAndServeTLS(":8080", cert_file, key_file, nil)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
if hostname == "mbook" { // My test environment
|
||||
err = http.ListenAndServe(":8080", nil)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
} else {
|
||||
err = http.ListenAndServeTLS(":8080", cert_file, key_file, nil)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Println("We ended")
|
||||
log.Println("Fin")
|
||||
}
|
||||
|
||||
func HandleFuncWrapper(a func()) {
|
||||
|
Loading…
Reference in New Issue
Block a user