Update ctx.md ip documentation

pull/2371/head
RW 2023-03-14 11:24:11 +01:00 committed by GitHub
parent 634f163e3f
commit 0dee42a57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -614,6 +614,14 @@ app.Get("/", func(c *fiber.Ctx) error {
})
```
When registering the proxy request header in the fiber app, the ip address of the header is returned [(Fiber configuration)](fiber.md#config)
```go
app := fiber.New(fiber.Config{
ProxyHeader: fiber.HeaderXForwardedFor,
})
```
## IPs
Returns an array of IP addresses specified in the [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For) request header.