fiber
fiber copied to clipboard
proxy.Balancer middleware should handle http backend servers when using app.ListenTLS
need add req.URI().SetScheme("http")
in proxy.Balancer
req.SetRequestURI(utils.UnsafeString(req.RequestURI()))
// NOTE: if req.isTLS is true, SetRequestURI keeps the scheme as https.
// Reference: https://github.com/gofiber/fiber/issues/1762
if scheme := getScheme(utils.UnsafeBytes(copiedURL)); len(scheme) > 0 {
req.URI().SetSchemeBytes(scheme)
}
https://github.com/gofiber/fiber/blob/109ccdd4adbaf604c12186c41a2060f0eaf4424a/middleware/proxy/proxy.go#L80-L81
https://github.com/gofiber/fiber/blob/109ccdd4adbaf604c12186c41a2060f0eaf4424a/middleware/proxy/proxy.go#L180-L186
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
I moved to fasthttp.Client
insteadof HostClient
.
HTTP requests are OK, but WebSocket requests won't be forwarded.