1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 02:16:54 +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, Addr: conf.ListenAddr,
} }
logFile, err := os.OpenFile("output.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) // logFile, err := os.OpenFile("output.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if err != nil { // if err != nil {
log.Fatal("Could not create logfile: ", err) // log.Fatal("Could not create logfile: ", err)
} // }
server.SetupServerAndHandle(conf, nil) server.SetupServerAndHandle(conf, nil)
server.SetBuildStamp(BuildTime, BuildHash) server.SetBuildStamp(BuildTime, BuildHash)
go commandLineConsole() go commandLineConsole()
log.SetOutput(logFile)
if conf.UseSSL { if conf.UseSSL {
err = httpServer.ListenAndServeTLS(conf.SSLCertificateFile, conf.SSLKeyFile) go func() {
} else { if err := httpServer.ListenAndServeTLS(conf.SSLCertificateFile, conf.SSLKeyFile); err != nil {
err = httpServer.ListenAndServe() log.Fatal("ListenAndServeTLS: ", err)
}
}()
} }
if err != nil { if err = httpServer.ListenAndServe(); err != nil {
log.Fatal("ListenAndServe: ", err) log.Fatal("ListenAndServe: ", err)
} }
} }

View file

@ -70,6 +70,7 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
serveMux.HandleFunc("/", HTTPHandleRootURL) serveMux.HandleFunc("/", HTTPHandleRootURL)
serveMux.HandleFunc("/stats", HTTPShowStatistics) 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("/drop_backlog", HTTPBackendDropBacklog)
serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish) serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish)