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:
parent
0229274a6c
commit
121298af0e
2 changed files with 11 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue