add TLSConfig support for ghttp.Server

This commit is contained in:
John
2019-03-19 17:48:37 +08:00
parent 4e3d735b90
commit 80e0eae6b0
7 changed files with 57 additions and 18 deletions

View File

@ -9,7 +9,7 @@ func main() {
s.BindHandler("/", func(r *ghttp.Request){
r.Response.Writeln("来自于HTTPS的哈喽世界")
})
s.EnableHTTPS("/home/john/temp/server.crt", "/home/john/temp/server.key")
s.EnableHTTPS("./server.crt", "./server.key")
s.SetPort(8199)
s.Run()
}