*/
private static void addEasHeaders(HttpConnection connection, Request request)
throws IOException {
// GLASSFISH Request/Response does not extend HttpRequest/Response so
// we need to cast to Coyote Request/Response
CoyoteRequest cRequest = (CoyoteRequest) request;
// The front-end will add a HTTP header with information required for
// single signon
// e.g. x-eas-usercentric-ipcontext:
// clientip=1.2.3.4,clientport=5000,serverip=5.6.7.8,serverport=9080
String contextValue = "clientip=" + cRequest.getRemoteAddr() +
",clientport=" + cRequest.getRemotePort() + ",serverip=" +
cRequest.getLocalAddr() + ",serverport=" + cRequest.getLocalPort();
connection.printLine("x-eas-usercentric-ipcontext: " + contextValue);
// Send information to backend TrafficProcessor.
connection.printLine(EAS_HEADER_FRONTEND_IS_SECURE + ": " +
cRequest.isSecure());
connection.printLine(EAS_HEADER_FRONTEND_LOCAL_ADDRESS + ": " +
cRequest.getLocalAddr());
connection.printLine(EAS_HEADER_FRONTEND_LOCAL_PORT + ": " +
cRequest.getLocalPort());
}