title: Get HTTPClient from HTTPSampler to use it in Beanshell
body: <p>I have a test plan with the mix of normal HTTP samplers and JSR223 samplers. JSR223 I use to execute requests via protobuf protocol and HTTP samplers for simple GET/POST requests. </p>
  
  <p>During a test via SSL protocol, we have discovered a huge load on the Nginx due big amount of SSL handshakes provided by JSR223 samplers. The problem was that I created a new HTTPClient in every request:</p>
  
  <pre><code>CloseableHttpClient client = HttpClients.createDefault();
  </code></pre>
  
  <p>I fixed it with creation only one instance of this client on initial stage and reusage of it in every JSR223 sampler:</p>
  
  <pre><code>CloseableHttpClient client = vars.getObject("client");
  </code></pre>
  
  <p>So, now we have the situation when every thread is using two HTTPClients (one is using by HTTPSampler, one by JSR223). And the question is there any way to get the HTTPClient from the HTTPSampler to use it further in JSR223 to avoid double handshakes and so on.</p>
  
  <p>Looks like HTTPSamplers are transferring savedClient between each other during a test.</p>