gofiber / fiber

⚡️ Express inspired web framework written in Go
https://gofiber.io
MIT License
33.12k stars 1.63k forks source link

📝 [Proposal]: Fiber v3 add function to create client and pass fasthttp custom client in #3107

Open goriunov opened 3 weeks ago

goriunov commented 3 weeks ago

Feature Proposal Description

I believe there should be a way to pass custom fasthttp client in to the fiber http client, to allow more granular fine tuning by the users.

Alignment with Express API


HTTP RFC Standards Compliance


API Stability


Feature Examples

Naming can be improved but something along the lines:

cc := client.NewWithFasthttpClien(&fasthttp.Client{...})


### Checklist:

- [X] I agree to follow Fiber's [Code of Conduct](https://github.com/gofiber/fiber/blob/master/.github/CODE_OF_CONDUCT.md).
- [X] I have searched for existing issues that describe my proposal before opening this one.
- [X] I understand that a proposal that does not meet these guidelines may be closed without explanation.
welcome[bot] commented 3 weeks ago

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

gaby commented 3 weeks ago

@efectn Thoughts? Seems reasonable

luk3skyw4lker commented 3 weeks ago

Couldn't this also be achieved using an option within the existing New method? One option like CustomFastHttpClient or something that when omitted defaults to the internal Fiber fasthttp client. Not sure if this is good but just throwing ideas here