How can I get the user's IP address in nopCommerce 4?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
How can I get the user's IP address in nopCommerce 4?  `_httpContextAccessor.HttpContext.Request.Headers["HTTP_X_FORWARDED_FOR"]` and `_httpContextAccessor.HttpContext.Request.Headers["REMOTE_ADDR"]` are both coming up as empty.  This is running on my localhost in Visual Studio through Kestrel.

Thanks!

Jeremy
5 years ago
Guys, it looks like this does it:

_httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString()

Have a great day!

Jeremy
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.