Advertisement
arxeiss

Spamler serving

May 14th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.44 KB | None | 0 0
  1. // Listen on HTTP and provide redirect (if non-secure URL is defined)
  2. if len(config.NonSecureURL) > 0 {
  3.     go func() {
  4.         redirect := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
  5.             http.Redirect(w, req, "https://"+config.SecureURL+req.RequestURI, 302)
  6.         })
  7.         log.Error(http.ListenAndServe(config.NonSecureURL, redirect))
  8.     }()
  9. }
  10. log.Fatal(http.ListenAndServeTLS(config.SecureURL, config.Certificate, config.Key, router))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement