Need help with realip?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

137 Stars 33 Forks MIT License 23 Commits 9 Opened issues


a golang library that can get client's real public ip address from http request headers

Services available


Need anything else?

Contributors list

No Data



Go package that can be used to get client's real public IP, which usually useful for logging HTTP server.


  • Follows the rule of X-Real-IP
  • Follows the rule of X-Forwarded-For
  • Exclude local or private address


package main

import ""

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:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.