1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-03-05 07:55:23 +00:00

adding tls

This commit is contained in:
2016-10-28 21:27:04 +02:00
parent 6848ddadd0
commit 9c2e7bd754
5 changed files with 23 additions and 8 deletions

View File

@@ -24,5 +24,11 @@ func main(){
handle := gziphandler.GzipHandler(route.Routes())
log.Println("Starting Server...")
log.Println(http.ListenAndServe(":"+strconv.Itoa(configurations.Port), handle))
go func(){
log.Println(http.ListenAndServe(":"+strconv.Itoa(configurations.Port), handle))
}()
if configurations.TLSCertFile != "" && configurations.TLSKeyFile != "" {
log.Println(http.ListenAndServeTLS(":"+strconv.Itoa(configurations.TLSPort), configurations.TLSCertFile, configurations.TLSKeyFile, handle))
}
}