Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我应该从请求标头中获取“主机”吗?我显然可以访问 HttpHeaders 和 HttpServletRequest。
HTTPServletRequest.getRemoteAddr() 将返回远程 IP 地址。