org.eclipse.jetty.server.Request.getRemoteHost()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.eclipse.jetty.server.Request.getRemoteHost方法的一些代码示例,展示了Request.getRemoteHost的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRemoteHost方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:getRemoteHost

Request.getRemoteHost介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

@Signature
public String remoteHost() {
  return request.getRemoteHost();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@Override
public String getRemoteHost()
{
  if (_remoteHost != null)
    return _remoteHost;
  if (_remoteAddr != null)
    return _remoteAddr;
  return super.getRemoteHost();
}

代码示例来源:origin: bozaro/git-as-svn

public WebServer(@NotNull SharedContext context, @Nullable Server server, @NotNull WebServerConfig config, @NotNull EncryptionFactory tokenFactory) {
 this.context = context;
 this.server = server;
 this.config = config;
 this.tokenFactory = tokenFactory;
 if (server != null) {
  final ServletContextHandler contextHandler = new ServletContextHandler();
  contextHandler.setContextPath("/");
  handler = contextHandler.getServletHandler();
  final RequestLogHandler logHandler = new RequestLogHandler();
  logHandler.setRequestLog((request, response) -> {
   final User user = (User) request.getAttribute(User.class.getName());
   final String userName = (user == null || user.isAnonymous()) ? "" : user.getUserName();
   log.info("{}:{} - {} - \"{} {}\" {} {}", request.getRemoteHost(), request.getRemotePort(), userName, request.getMethod(), request.getHttpURI(), response.getStatus(), response.getReason());
  });
  final HandlerCollection handlers = new HandlerCollection();
  handlers.addHandler(contextHandler);
  handlers.addHandler(logHandler);
  server.setHandler(handlers);
 } else {
  handler = null;
 }
}

代码示例来源:origin: jenkinsci/winstone

{"###dnt###", nvl(request.getHeader("DNT"))},
{"###via###", nvl(request.getHeader("Via"))},
{"###ip###", request.getRemoteHost()},
{"###user###", nvl(remoteUser)},
{"###time###", "[" + date + "]"},

相关文章

Request类方法