1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-06 14:20:56 +00:00

Oops, SSL needs a different listen address..

This commit is contained in:
Kane York 2015-11-23 16:08:22 -08:00
parent 6f13ea360c
commit 6a5bcdca4a
3 changed files with 5 additions and 7 deletions

View file

@ -43,29 +43,25 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
httpServer := &http.Server{
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, http.DefaultServeMux)
server.SetBuildStamp(BuildTime, BuildHash) server.SetBuildStamp(BuildTime, BuildHash)
go commandLineConsole() go commandLineConsole()
if conf.UseSSL { if conf.UseSSL {
go func() { go func() {
if err := httpServer.ListenAndServeTLS(conf.SSLCertificateFile, conf.SSLKeyFile); err != nil { if err := http.ListenAndServeTLS(conf.SSLListenAddr, conf.SSLCertificateFile, conf.SSLKeyFile, http.DefaultServeMux); err != nil {
log.Fatal("ListenAndServeTLS: ", err) log.Fatal("ListenAndServeTLS: ", err)
} }
}() }()
} }
if err = httpServer.ListenAndServe(); err != nil { if err = http.ListenAndServe(conf.ListenAddr, http.DefaultServeMux); err != nil {
log.Fatal("ListenAndServe: ", err) log.Fatal("ListenAndServe: ", err)
} }
} }

View file

@ -269,6 +269,7 @@ func GenerateKeys(outputFile, serverID, theirPublicStr string) {
var err error var err error
output := ConfigFile{ output := ConfigFile{
ListenAddr: "0.0.0.0:8001", ListenAddr: "0.0.0.0:8001",
SSLListenAddr: "0.0.0.0:443",
SocketOrigin: "localhost:8001", SocketOrigin: "localhost:8001",
BackendURL: "http://localhost:8002/ffz", BackendURL: "http://localhost:8002/ffz",
MinMemoryKBytes: defaultMinMemoryKB, MinMemoryKBytes: defaultMinMemoryKB,

View file

@ -15,6 +15,7 @@ type ConfigFile struct {
// Numeric server id known to the backend // Numeric server id known to the backend
ServerID int ServerID int
ListenAddr string ListenAddr string
SSLListenAddr string
// Hostname of the socket server // Hostname of the socket server
SocketOrigin string SocketOrigin string
// URL to the backend server // URL to the backend server