2016-05-30 16:08:09 +02:00
|
|
|
package iriscontrol
|
|
|
|
|
|
|
|
// for the main server
|
|
|
|
func (i *irisControlPlugin) StartServer() {
|
2016-06-14 07:45:40 +02:00
|
|
|
if i.station.HTTPServer.IsListening() == false {
|
|
|
|
if i.station.HTTPServer.IsSecure() {
|
2016-05-30 16:08:09 +02:00
|
|
|
//listen with ListenTLS
|
2016-06-14 07:45:40 +02:00
|
|
|
i.station.ListenTLS(i.station.Config.Server.ListeningAddr, i.station.Config.Server.CertFile, i.station.Config.Server.KeyFile)
|
2016-05-30 16:08:09 +02:00
|
|
|
} else {
|
|
|
|
//listen normal
|
2016-06-14 07:45:40 +02:00
|
|
|
i.station.Listen(i.station.Config.Server.ListeningAddr)
|
2016-05-30 16:08:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *irisControlPlugin) StopServer() {
|
2016-06-14 07:45:40 +02:00
|
|
|
if i.station.HTTPServer.IsListening() {
|
2016-05-30 16:08:09 +02:00
|
|
|
i.station.Close()
|
|
|
|
}
|
|
|
|
}
|