mirror of
https://gitee.com/johng/gf
synced 2026-07-05 21:32:17 +08:00
update project structure
This commit is contained in:
17
example/net/ghttp/server/https/https_http.go
Normal file
17
example/net/ghttp/server/https/https_http.go
Normal file
@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/net/ghttp"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := ghttp.GetServer()
|
||||
s.BindHandler("/", func(r *ghttp.Request) {
|
||||
r.Response.Writeln("您可以同时通过HTTP和HTTPS方式看到该内容!")
|
||||
})
|
||||
s.EnableHTTPS("./server.crt", "./server.key")
|
||||
s.SetHTTPSPort(8100, 8200)
|
||||
s.SetPort(8300, 8400)
|
||||
s.EnableAdmin()
|
||||
s.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user