1.服务端获取客户端请求的IP等信息request = javax.servlet.http.HttpServletRequest
request.getRemoteAddr() 获取客户端请求IP地址
request.getRemotePort() 获取客户端请求端口
request.getRemoteHost() 获取客户端请求的合法名称
request.getRemoteUser() a String
specifying the login of the user making this request, or null
if the user login is not known
request.getUserPrincipal() a java.security.Principal
containing the name of the user making this request; null
if the user has not been authenticated
request.getCharacterEncoding() 获取字符编码
2.手机每连一次4G,IP及端口都会对应变更一次
3.具有固定IP的局域网通过路由器可设置对外网的访问路径及端口。路由器上设置对外的端口PORT,再映射到局域网内某台电脑A及该台电脑的某个端口A_port,那么外网访问该固定IP+对外PORT时,即可访问到A的A_port路径上。