Both server running. SSL and Non SSL

This commit is contained in:
Welington Sampaio
2016-03-03 14:54:53 -03:00
parent 051da185e5
commit e93145efe7
3 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -32,7 +32,12 @@ func Start(configfile string) error {
router := newRouter()
if conf.Encrypted {
if err := http.ListenAndServeTLS(conf.Host, conf.SSLPublicKey, conf.SSLPrivateKey, router); err != nil {
go func () {
if err := http.ListenAndServe(conf.Host, router); err != nil {
return err
}
}
if err := http.ListenAndServeTLS(conf.SSLHost, conf.SSLPublicKey, conf.SSLPrivateKey, router); err != nil {
return err
}
}else{