Request.UserHostAddress issue with return result “::1”

前端 未结 4 1725
有刺的猬
有刺的猬 2020-12-03 06:18

I am trying to get client ip address using

    HttpContext.Request.UserHostAddress;

but it returns ::1.

How to solve

4条回答
  •  清歌不尽
    2020-12-03 06:58

    it is not bug actually you are running your application on local host it is just giving you the ip of of local host and it is ipv6 format

提交回复
热议问题