Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add forward from domain #2323

Merged
merged 6 commits into from
Feb 3, 2023
Merged

add forward from domain #2323

merged 6 commits into from
Feb 3, 2023

Conversation

ryanbekhen
Copy link
Member

@ryanbekhen ryanbekhen commented Feb 3, 2023

Description

Add proxy forward from spesific domain. Hope this helps with the subdomain routing problem and balancer problom in https.

Fixes #2295 #2307

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - https:/gofiber/docs for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@welcome
Copy link

welcome bot commented Feb 3, 2023

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@ryanbekhen
Copy link
Member Author

I also added a feature for issue #2307. In commit add balancer forward.

Copy link
Member

@ReneWerner87 ReneWerner87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comments

@ryanbekhen
Copy link
Member Author

I have added a unit test and completed the readme, please check.

@ReneWerner87
Copy link
Member

@ryanbekhen can you check my last comment from the review

@ryanbekhen
Copy link
Member Author

@ReneWerner87 I have added a short description to the signature in the readme in last commit.

@ReneWerner87
Copy link
Member

@ryanbekhen can you do this for all the methods listed so you have a good overview and know where they differ

@ryanbekhen
Copy link
Member Author

@ReneWerner87 Is it like this?

// Balancer create a load balancer among multiple upstrem servers.
func Balancer(config Config) fiber.Handler
// Forward performs the given http request and fills the given http response.
func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler
// Do performs the given http request and fills the given http response.
func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error
// DomainForward the given http request based on the given domain and fills the given http response
func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler
// BalancerForward performs the given http request based round robin balancer and fills the given http response
func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler

@ReneWerner87
Copy link
Member

yes

@ryanbekhen
Copy link
Member Author

@ReneWerner87 please check again

@ReneWerner87
Copy link
Member

@ryanbekhen pls fix the golangci-lint hints

@ReneWerner87 ReneWerner87 merged commit 61a3336 into gofiber:master Feb 3, 2023
@welcome
Copy link

welcome bot commented Feb 3, 2023

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 [Feature]: Subdomain routing
2 participants