@Override public InetSocketAddress getRemoteAddress() { return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort()); }
@Override public InetSocketAddress getRemoteAddress() { return new InetSocketAddress(this.servletRequest.getRemoteHost(), this.servletRequest.getRemotePort()); }
/** {@inheritDoc} */ public int getRemotePort() { return request.getRemotePort(); }
@Override public InetSocketAddress getRemoteAddress() { return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort()); }
@Override public InetSocketAddress getRemoteAddress() { return new InetSocketAddress(this.servletRequest.getRemoteHost(), this.servletRequest.getRemotePort()); }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String uri = request.getRequestURI(); HttpInvokerServiceExporter skeleton = skeletonMap.get(uri); if (!request.getMethod().equalsIgnoreCase("POST")) { response.setStatus(500); } else { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); try { skeleton.handleRequest(request, response); } catch (Throwable e) { throw new ServletException(e); } } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String uri = request.getRequestURI(); HttpInvokerServiceExporter skeleton = skeletonMap.get(uri); if (!request.getMethod().equalsIgnoreCase("POST")) { response.setStatus(500); } else { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); try { skeleton.handleRequest(request, response); } catch (Throwable e) { throw new ServletException(e); } } }
public static RequestData from( HttpServletRequest req ) { return new RequestData( req.getRemoteAddr(), req.isSecure(), req.getRemotePort(), req.getLocalName(), req.getLocalAddr(), req.getLocalPort(), req.getAuthType() == null ? "" : req.getAuthType() ); } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String uri = request.getRequestURI(); HessianSkeleton skeleton = skeletonMap.get(uri); if (!request.getMethod().equalsIgnoreCase("POST")) { response.setStatus(500); } else { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); Enumeration<String> enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String key = enumeration.nextElement(); if (key.startsWith(Constants.DEFAULT_EXCHANGER)) { RpcContext.getContext().setAttachment(key.substring(Constants.DEFAULT_EXCHANGER.length()), request.getHeader(key)); } } try { skeleton.invoke(request.getInputStream(), response.getOutputStream()); } catch (Throwable e) { throw new ServletException(e); } } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String uri = request.getRequestURI(); HessianSkeleton skeleton = skeletonMap.get(uri); if (!request.getMethod().equalsIgnoreCase("POST")) { response.setStatus(500); } else { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); Enumeration<String> enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String key = enumeration.nextElement(); if (key.startsWith(Constants.DEFAULT_EXCHANGER)) { RpcContext.getContext().setAttachment(key.substring(Constants.DEFAULT_EXCHANGER.length()), request.getHeader(key)); } } try { skeleton.invoke(request.getInputStream(), response.getOutputStream()); } catch (Throwable e) { throw new ServletException(e); } } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); dispatcher.service(request, response); } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); dispatcher.service(request, response); } }
private PeerDescription getSourcePeerDescription(@Context HttpServletRequest req) { return new PeerDescription(req.getRemoteHost(), req.getRemotePort(), req.isSecure()); }
private RequestMetadata extractMetadata(HttpServletRequest req) { return HttpRequestMetadata.create( Instant.now(), Optional.of(serverInfo), Optional.of(RequestMetadataImpl.hostAndPort(req.getRemoteHost(), req.getRemotePort())), req.getProtocol() ); }
/** * This sets the client IP:port to the {@linkplain HttpServletRequest#getRemoteAddr() remote * address} if the {@link HttpServerAdapter#parseClientIpAndPort default parsing} fails. */ @Override public boolean parseClientIpAndPort(HttpServletRequest req, Span span) { if (parseClientIpFromXForwardedFor(req, span)) return true; return span.remoteIpAndPort(req.getRemoteAddr(), req.getRemotePort()); }
@Override public int getRemotePort() { return isNotNoOps() ? b.request.getRemotePort() : b.lazyRemote != null ? b.lazyRemote.getPort() : b.remotePort; }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (servletController == null) { HttpServlet httpServlet = DispatcherServlet.getInstance(); if (httpServlet == null) { response.sendError(500, "No such DispatcherServlet instance."); return; } synchronized (this) { if (servletController == null) { servletController = new ServletController(transportFactory.getRegistry(), httpServlet.getServletConfig(), httpServlet); } } } RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); servletController.invoke(request, response); }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (servletController == null) { HttpServlet httpServlet = DispatcherServlet.getInstance(); if (httpServlet == null) { response.sendError(500, "No such DispatcherServlet instance."); return; } synchronized (this) { if (servletController == null) { servletController = new ServletController(transportFactory.getRegistry(), httpServlet.getServletConfig(), httpServlet); } } } RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); servletController.invoke(request, response); }
@Override public void filter(ContainerRequestContext requestContext) throws IOException { HttpServletRequest request = ResteasyProviderFactory.getContextData(HttpServletRequest.class); RpcContext.getContext().setRequest(request); // this only works for servlet containers if (request != null && RpcContext.getContext().getRemoteAddress() == null) { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); } RpcContext.getContext().setResponse(ResteasyProviderFactory.getContextData(HttpServletResponse.class)); String headers = requestContext.getHeaderString(DUBBO_ATTACHMENT_HEADER); if (headers != null) { for (String header : headers.split(",")) { int index = header.indexOf("="); if (index > 0) { String key = header.substring(0, index); String value = header.substring(index + 1); if (!StringUtils.isEmpty(key)) { RpcContext.getContext().setAttachment(key.trim(), value.trim()); } } } } }
@Override public void filter(ContainerRequestContext requestContext) throws IOException { HttpServletRequest request = ResteasyProviderFactory.getContextData(HttpServletRequest.class); RpcContext.getContext().setRequest(request); // this only works for servlet containers if (request != null && RpcContext.getContext().getRemoteAddress() == null) { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); } RpcContext.getContext().setResponse(ResteasyProviderFactory.getContextData(HttpServletResponse.class)); String headers = requestContext.getHeaderString(DUBBO_ATTACHMENT_HEADER); if (headers != null) { for (String header : headers.split(",")) { int index = header.indexOf("="); if (index > 0) { String key = header.substring(0, index); String value = header.substring(index + 1); if (!StringUtils.isEmpty(key)) { RpcContext.getContext().setAttachment(key.trim(), value.trim()); } } } } }