get host ip address asp.net core

Code Example - get host ip address asp.net core

                
                        var httpConnectionFeature = httpContext.Features.Get<IHttpConnectionFeature>();
var localIpAddress = httpConnectionFeature?.LocalIpAddress;