Files
gf/geg/net/ghttp/https/https_http.go

18 lines
434 B
Go
Raw Normal View History

package main
import (
"gitee.com/johng/gf/g/net/ghttp"
)
func main() {
s := ghttp.GetServer()
2018-05-13 22:00:10 +08:00
s.EnableAdmin()
s.BindHandler("/", func(r *ghttp.Request){
r.Response.Writeln("您可以同时通过HTTP和HTTPS方式看到该内容")
})
s.EnableHTTPS("/home/john/temp/server.crt", "/home/john/temp/server.key")
s.SetHTTPSPort(8198, 8199)
s.SetPort(8200, 8300)
s.EnableAdmin()
s.Run()
}