相关问题
- How to change the IP address of a docker after cre
- Google recaptcha remoteip explanation
- Embed RTSP Stream into Browser
- Restrict User Activity Based on IP or on Cookie?
- Find IP of program trying to connect to ServerSock
相关文章
- PostgreSQL field data type for IPv4 addresses
- How to find that an IP address is a LAN IP or WAN
- Direct IP call android
- Automate ftp upload to ip
- Connect to another computer using IP address
- jQuery JSON request gets a '200 OK' answer
- Adding client IP info into django logger
- How to check if server is sending out spam?
client 获取服务端的ip地址:可以直接ping域名得到ip,可以api请求从response里面获得ip;
server获取client的ip地址:request对象有remote host,x-forwarded-for代理地址等。可以百度一下
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
var ip = Request.Host;
return new string[] { ip.Value };
}
}
另外推荐一个ip地址定位库ip2region
没懂你的意思,你是服务端,想知道访问的来源IP么?有函数直接可以取呀