filebrowser/backend/vendor/github.com/tomasen/realip
Graham Steffaniak b928e6557c updated with a few changes
- git directory structure changed (no more src folder)
 - search now works with filesize larger/smaller than x MB
 - search currently allows for only one search request at a time
   - cancels older requests by having them immediately return null
2023-07-21 17:41:24 -05:00
..
.travis.yml updated with a few changes 2023-07-21 17:41:24 -05:00
LICENSE updated with a few changes 2023-07-21 17:41:24 -05:00
README.md updated with a few changes 2023-07-21 17:41:24 -05:00
realip.go updated with a few changes 2023-07-21 17:41:24 -05:00

README.md

RealIP

GoDoc

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

Feature

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

Example

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)
}

Developing

Commited code must pass: