MCPcopy
hub / github.com/gofiber/fiber / Forward

Function Forward

middleware/proxy/proxy.go:143–148  ·  view source on GitHub ↗

Forward performs the given http request and fills the given http response. This method will return a fiber.Handler

(addr string, clients ...*fasthttp.Client)

Source from the content-addressed store, hash-verified

141// Forward performs the given http request and fills the given http response.
142// This method will return a fiber.Handler
143func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler {
144 return func(c fiber.Ctx) error {
145 c.Request().Header.Set("X-Real-IP", c.IP())
146 return Do(c, addr, clients...)
147 }
148}
149
150// Do performs the given http request and fills the given http response.
151// This method can be used within a fiber.Handler

Calls 4

DoFunction · 0.85
SetMethod · 0.65
RequestMethod · 0.65
IPMethod · 0.65