@Override public ZuulMessage create(SessionContext context, HttpServerRequest httpServerRequest) { // Get the client IP (ignore XFF headers at this point, as that can be app specific). String clientIp = getIpAddress(httpServerRequest.getNettyChannel()); // TODO - How to get uri scheme from the netty request? String scheme = "http"; // This is the only way I found to get the port of the request with netty... int port = ((InetSocketAddress) httpServerRequest.getNettyChannel().localAddress()).getPort(); String serverName = ((InetSocketAddress) httpServerRequest.getNettyChannel().localAddress()).getHostString(); // Setup the req/resp message objects. HttpRequestMessage request = new HttpRequestMessage( context, httpServerRequest.getHttpVersion().text(), httpServerRequest.getHttpMethod().name().toLowerCase(), httpServerRequest.getUri(), copyQueryParams(httpServerRequest), copyHeaders(httpServerRequest), clientIp, scheme, port, serverName ); // Store this original request info for future reference (ie. for metrics and access logging purposes). request.storeOriginalRequestInfo(); return wrapBody(request, httpServerRequest); }