title: Varnish VCL: how can I switch on req.backend_hint?
body: <p>I have the following VCL:</p>
  
  <pre><code>vcl 4.0;
  
  import std;
  import directors;
  
  backend one {
      .host = "localhost";
      .port = "3333";
  }
  
  backend two {
      .host = "localhost";
      .port = "3333";
  }
  
  sub vcl_init {
      new random_director = directors.random();
      random_director.add_backend(two, 10);
      random_director.add_backend(one, 8);
  }
  
  sub vcl_recv {
  
      std.log("start vcl_recv");
  
      set req.backend_hint = random_director.backend();
      if (req.backend_hint == one) {
          std.log("one");
      } else if (req.backend_hint == two) {
          std.log("two");
      } else {
          std.log("neither one");
      }
  
      std.log("end vcl_recv");
  }
  </code></pre>
  
  <p>When I run it, the output is always:</p>
  
  <pre><code>start vl_recv
  neither one
  end vcl_recv
  </code></pre>
  
  <p>How can I properly check to see which backend has been selected?</p>
  
  <p>Thanks</p>