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

Can I customize Balancing Strategies in gobetween: select same backend if parameter GuideID % 2 return same value? - Tag Quesion #114

Open
chiennv97 opened this issue Oct 20, 2017 · 1 comment

Comments

@chiennv97
Copy link

Hello, I want to customize Balancing Strategies in gobetween. I need your help!

I want to New Balancing Strategies: select same backend if parameter GuideID % 2 return same value

Example:

  • I have server A: localhost:9997, server B localhost:9998

  • Server GoBetween: localhost:8080

  • Parameter GuideID % 2 == 1 ---> forward request to server A

  • Parameter GuideID % 2 == 0---> forward request to server B

  • Request 1: http://localhost:8080?guideid=113 ---> forward request to server A because 113 % 2 == 1

  • Request 2: http://localhost:8080?guideid=112 ---> forward request to server B because 112 % 2 == 0

Thanks you!

PS: Sorry, but I can't add tag question in this issue. I don't know why :((

@yyyar
Copy link
Owner

yyyar commented Oct 20, 2017

Hi @chiennv97!

Thanks for your interest in gobetween!

Unfortunately the problem you have can't be currently solved with gobetween (on L4 where gobetween operates, i.e. TCP/UDP/etc.). We do not parse HTTP so can't access query parameters or any other data from the HTTP request.

But we definitely planning to add kind of L7 (and HTTP) protocols support to gobetween, as well as custom rules/customization of requests processing flow, in future.
We just need to figure out how to do it better in context of gobetween.

Keep tuned :-)

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

No branches or pull requests

2 participants