1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 18:06:55 +00:00

Add LE support, listen on HTTPS and HTTP

This commit is contained in:
Kane York 2015-11-17 13:36:34 -08:00
parent 0229274a6c
commit 121298af0e
2 changed files with 11 additions and 10 deletions

View file

@ -47,25 +47,25 @@ func main() {
Addr: conf.ListenAddr,
}
logFile, err := os.OpenFile("output.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
log.Fatal("Could not create logfile: ", err)
}
// logFile, err := os.OpenFile("output.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
// if err != nil {
// log.Fatal("Could not create logfile: ", err)
// }
server.SetupServerAndHandle(conf, nil)
server.SetBuildStamp(BuildTime, BuildHash)
go commandLineConsole()
log.SetOutput(logFile)
if conf.UseSSL {
err = httpServer.ListenAndServeTLS(conf.SSLCertificateFile, conf.SSLKeyFile)
} else {
err = httpServer.ListenAndServe()
go func() {
if err := httpServer.ListenAndServeTLS(conf.SSLCertificateFile, conf.SSLKeyFile); err != nil {
log.Fatal("ListenAndServeTLS: ", err)
}
}()
}
if err != nil {
if err = httpServer.ListenAndServe(); err != nil {
log.Fatal("ListenAndServe: ", err)
}
}

View file

@ -70,6 +70,7 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
serveMux.HandleFunc("/", HTTPHandleRootURL)
serveMux.HandleFunc("/stats", HTTPShowStatistics)
serveMux.Handle("/.well-known", http.FileServer(http.FileSystem(http.Dir("/tmp/letsencrypt/.well-known"))))
serveMux.HandleFunc("/drop_backlog", HTTPBackendDropBacklog)
serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish)