|
|
hace 8 años | |
|---|---|---|
| .. | ||
| .travis.yml | hace 8 años | |
| README.md | hace 8 años | |
| realip.go | hace 8 años | |
| realip_test.go | hace 8 años | |
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: