https://github.com/zhooravell/fasthttp-realip
https://github.com/zhooravell/fasthttp-realip
client-ip fasthttp go golang golang-library realip
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhooravell/fasthttp-realip
- Owner: zhooravell
- License: mit
- Created: 2021-10-07T13:26:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-07T13:32:42.000Z (over 4 years ago)
- Last Synced: 2025-01-12T07:11:56.004Z (over 1 year ago)
- Topics: client-ip, fasthttp, go, golang, golang-library, realip
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FastHTTP RealIP
===============
> Go package that can be used to get client's real public IP from Fast HTTP request.
[![License][license-image]][license-link]
[![Build][build-image]][build-link]
# Example
```go
package main
import (
"log"
"github.com/valyala/fasthttp"
"github.com/zhooravell/fasthttp-realip"
)
func main() {
if err := fasthttp.ListenAndServe(":8080", requestHandler); err != nil {
log.Fatalf("Error in ListenAndServe: %s", err)
}
}
func requestHandler(ctx *fasthttp.RequestCtx) {
log.Println("Client IP: " + realip.FromRequest(ctx))
}
```
[license-link]: https://github.com/zhooravell/fasthttp-realip/blob/master/LICENSE
[license-image]: https://img.shields.io/dub/l/vibe-d.svg
[build-image]: https://github.com/zhooravell/fasthttp-realip/actions/workflows/go.yml/badge.svg
[build-link]: https://github.com/zhooravell/fasthttp-realip/actions