The problem with load balancing an API port, is there is no session to go by. So when a load balancer injects a cookie to keep track of which backend the previous request went to, we need to pick up and provide the same cookie to subsequent requests.
Unfortunately, the upstream Splunk Ruby SDK is dead, but fortunately, they provided a way for us to provide a wrapper proxy around Net:HTTP.
The problem with load balancing an API port, is there is no session to go by. So when a load balancer injects a cookie to keep track of which backend the previous request went to, we need to pick up and provide the same cookie to subsequent requests.
Unfortunately, the upstream Splunk Ruby SDK is dead, but fortunately, they provided a way for us to provide a wrapper proxy around Net:HTTP.
The method of parsing the set-cookie header comes from: https://stackoverflow.com/a/10545462/504685
Also featuring in this pull request:
Not featured: