|
|
8 лет назад | |
|---|---|---|
| .. | ||
| .travis.yml | 8 лет назад | |
| README.md | 8 лет назад | |
| realip.go | 8 лет назад | |
| realip_test.go | 8 лет назад | |
Go package that can be used to get client's real public IP, which usually useful for logging HTTP server.
package main
import "github.com/Tomasen/realip"
func (h *Handler) ServeIndexPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
clientIP := realip.FromRequest(r)
log.Println("GET / from", clientIP)
}
Commited code must pass: