func main(){ runtime.GOMAXPROCS(runtime.NumCPU()) r := mux.NewRouter() www := r.Host("secure.domain.com").Subrouter() www.HandleFunc("/", Handler_www) api := r.Host("api.domain.com").Subrouter() api.HandleFunc("/", Handler_api) go func(){ cert := "/var/ini/ssl/secure.domain.com/intermediate.crt" prv_key := "/var/ini/ssl/secure.domain.com/private.key" err := http.ListenAndServeTLS(":9443", cert, prv_key, r) if err != nil { log.Fatal("HTTPS server: ", err) } } err := http.ListenAndServe(":9000", r) if err != nil { log.Fatal("HTTP server: ", err) }}
1 回答
- 1 回答
- 0 关注
- 400 浏览
添加回答
举报
0/150
提交
取消