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

Should DisableKeepAlives be set to true? #2

Open
sybrandy opened this issue Sep 4, 2015 · 1 comment
Open

Should DisableKeepAlives be set to true? #2

sybrandy opened this issue Sep 4, 2015 · 1 comment

Comments

@sybrandy
Copy link
Contributor

sybrandy commented Sep 4, 2015

Hello,

I'm using your code and when I got the logic working for my service, I noticed that it would only connect to one of the nodes I wanted to proxy to and not switch. What I was hoping for was that it would switch between nodes on every connection. (FYI, I implemented a round-robin algorithm)

So, my question is: should DisableKeepAlives be set to true on the http.Transport variable created in NewMultipleHostReverseProxy? Or am I missing something? Perhaps this could be something that is set when you call the method?

@creack
Copy link
Owner

creack commented Sep 10, 2015

Sorry for the late answer, I have been traveling.

This is the expected behavior. If you start multiple connections, it will switch to an other node. I explain the behavior here: https://www.youtube.com/watch?v=OKZ1Pea_qsg&list=PL2ntRZ1ySWBeHqlHM8DmvS8axgbrpvF9b&index=11 (7 mins).

If you think that DisableKeepAlives would be important, feel free to submit a PR :) I'll be happy to merge it.

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

No branches or pull requests

2 participants