// RunHTTPRedirectServer to send all HTTP traffic to HTTPS
RunHTTPRedirectServer to send all HTTP traffic to HTTPS
// RunHTTPRedirectServer to send all HTTP traffic to HTTPS
func RunHTTPRedirectServer() (s *http.Server) {
	s = &http.Server{
		ReadTimeout:  5 * time.Second,
		WriteTimeout: 5 * time.Second,
		Handler: http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
			w.Header().Set("Connection", "close")
			url := "https://" + req.Host + req.URL.String()
			http.Redirect(w, req, url, http.StatusMovedPermanently)
		}),
	}
	go func() { log.Fatal(s.ListenAndServe()) }()
	return s
}
func RunHTTPRedirectServer ( ) ( s * http . Server ) { s = & http . Server { ReadTimeout : 5 * time . Second , WriteTimeout : 5 * time . Second , Handler : http . HandlerFunc ( func ( w http . ResponseWriter , req * http . Request ) { w . Header ( ) . Set ( " " , " " ) url := " " + req . Host + req . URL . String ( ) http . Redirect ( w , req , url , http . StatusMovedPermanently ) } ) , } go func ( ) { log . Fatal ( s . ListenAndServe ( ) ) } ( ) return s }
RunHTTPRedirectServer to send all HTTP traffic to HTTPS
RunHTTPRedirectServer to send all HTTP traffic to HTTPS