title: Undertow: How to control choosing host depends on request body content?
body: <p>I try to implement my own proxy like this:</p>
  
  <pre><code>LoadBalancingProxyClient loadBalancer = new LoadBalancingProxyClient()
          .addHost(new URI("http://localhost:8080"))
          .addHost(new URI("http://localhost:7777"))
          .setConnectionsPerThread(20);
  
  Undertow reverseProxy = Undertow.builder()
          .addHttpListener(8081, "localhost")
          .setIoThreads(1)
          .setHandler(ProxyHandler.builder().setProxyClient(loadBalancer).setMaxRequestTime(30000).build())
          .build();
  reverseProxy.start();
  </code></pre>
  
  <p>I want to have control over choosing proxy server. Depends on request body I want to choose <code>localhost:8080</code> or <code>localhost:7777</code></p>
  
  <p>Is it possible in Undertow proxy?</p>
  
  <p>P.S. I am ready to switch to another proxy if it is impossible for undertow</p>