@Test public void proxyShouldRelayTheOriginSourceIPAddress(){ HttpObject subject = new Proxy("http: Request input = new MockRequest( new ConnectionInfo("dummy-local-ip-address",8080,"dummy-remote-ip-address",10001), subject, "/headerEcho", new Query(""), HttpObject.Text("does not matter")); Response output = subject.get(input); String representation = HttpObjectUtil.toAscii(output.representation()); System.out.println("representation = " + representation); assertThat(representation, containsString("X-Forwarded-For=dummy-remote-ip-address")); }
@Override public Response get(Request req) { return proxyRequest(req, new GetMethod()); }
Proxy extends HttpObject { @Override public Response get(Request req) { return proxyRequest(req, new GetMethod()); } }
Proxy extends HttpObject { @Override public Response get(Request req) { return proxyRequest(req, new GetMethod()); } Proxy(final String localPath, final String base, final String me);  Proxy(final String base, final String me); }
Proxy extends HttpObject { @Override public Response get(Request req) { return proxyRequest(req, new GetMethod()); } Proxy(final String localPath, final String base, final String me);  Proxy(final String base, final String me); void setBase(String base); String getBase(); @Override Response get(Request req); @Override Response delete(Request req); @Override Response put(Request req); @Override Response patch(Request req); @Override Response options(Request req); @Override Response post(Request req); }
Proxy extends HttpObject { @Override public Response get(Request req) { return proxyRequest(req, new GetMethod()); } Proxy(final String localPath, final String base, final String me);  Proxy(final String base, final String me); void setBase(String base); String getBase(); @Override Response get(Request req); @Override Response delete(Request req); @Override Response put(Request req); @Override Response patch(Request req); @Override Response options(Request req); @Override Response post(Request req);  }