package water.webserver.jetty9;

import org.eclipse.jetty.client.HttpExchange;
import org.eclipse.jetty.proxy.ProxyServlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

/**
 * Transparent proxy that automatically adds authentication to each request
 */
public class TransparentProxyServlet extends ProxyServlet.Transparent {
  private String _basicAuth;

  @Override
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    _basicAuth = config.getInitParameter("BasicAuth");
  }




  protected void customizeExchange(HttpExchange exchange, HttpServletRequest request) {
    exchange.getRequest().header("Authorization", _basicAuth);
  }
}

@@ -239,16 +239,109 @@
 equest;%0A
+import javax.servlet.http.HttpServletResponse;%0Aimport org.eclipse.jetty.client.api.Request;%0A%0A
 %0A/**%0A * 
@@ -682,18 +682,27 @@
 );%0A  %7D%0A%0A
-%0A%0A
+  @Override
 %0A  prote
@@ -715,49 +715,24 @@
 oid 
-customizeExchange(HttpExchange exchange, 
+addProxyHeaders(
 Http
@@ -750,44 +750,96 @@
 est 
-r
+clientR
 equest
-) %7B
+,
 %0A    
-exchange.get
+                             Request proxyRequest) %7B%0A    proxy
 Request
-()
 .hea

Fix proxy.