Added global ServeTLS function to be consistent with Server.ServeTLS

This commit is contained in:
Aliaksandr Valialkin
2016-02-03 16:21:42 +02:00
parent 33e5464e41
commit 2b4309d53d
+11
View File
@@ -53,6 +53,17 @@ func Serve(ln net.Listener, handler RequestHandler) error {
return s.Serve(ln)
}
// ServeTLS serves HTTPS requests from the given net.Listener
// using the given handler.
//
// certFile and keyFile are paths to TLS certificate and key files.
func ServeTLS(ln net.Listener, certFile, keyFile string, handler RequestHandler) error {
s := &Server{
Handler: handler,
}
return s.ServeTLS(ln, certFile, keyFile)
}
// ListenAndServe serves HTTP requests from the given TCP addr
// using the given handler.
func ListenAndServe(addr string, handler RequestHandler) error {