Minor changes

This commit is contained in:
Mihalis Tsoukalos 2019-05-17 09:32:53 +03:00
commit f73cd78c2a

View file

@ -8,11 +8,13 @@ import (
"net/http"
)
var PORT = ":1443"
type handler struct {
}
func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("Hello there securely!\n"))
w.Write([]byte("Hello world!\n"))
}
func main() {
@ -30,10 +32,10 @@ func main() {
}
srv := &http.Server{
Addr: ":8443",
Addr: PORT,
Handler: &handler{},
TLSConfig: cfg,
}
fmt.Println("Listening to port number", PORT)
fmt.Println(srv.ListenAndServeTLS("server.crt", "server.key"))
}