An open API service indexing awesome lists of open source software.

https://github.com/codeskyblue/realip

Get real IP behide nginx (Do not ignore private address)
https://github.com/codeskyblue/realip

Last synced: about 1 month ago
JSON representation

Get real IP behide nginx (Do not ignore private address)

Awesome Lists containing this project

README

        

# RealIP
Get real IP behide nginx (Do not ignore private address)

Follows the rule of `X-Forwardd-For` and `X-Real-IP`

Refs:

## Install
```
go get -v github.com/codeskyblue/realip
```

## Usage
```go
package main

import "github.com/codeskyblue/realip"

func (h *Handler) ServeIndexPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
clientIP := realip.FromRequest(r)
log.Println("GET / from", clientIP)
}
```

## Thanks to
-

# LICENSE
[MIT](LICENSE)