/heroku

Read http headers add by heroku HTTP Routing

Primary LanguageGoMIT LicenseMIT

Heroku GoDoc

Package heroku read http headers add by heroku HTTP Routing

Installation

$ go get github.com/yassinouider/heroku

Usage

Show ip and more info from heroku HTTP Routing

func ShowIP(w http.ResponseWriter, r *http.Request) {
  headers := heroku.NewHeaders(r)
  ip := headers.For

  fmt.Fprintf(w, "ip: %s", ip)
}

Middleware force redirect http to https

http.Handle("/" heroku.RedirectToHTTPS(myHandler))