1 override of RemoteIpAddress
Microsoft.AspNetCore.Http (1)
Internal\DefaultConnectionInfo.cs (1)
56public override IPAddress? RemoteIpAddress
17 writes to RemoteIpAddress
HttpAbstractions.SampleApp (1)
Program.cs (1)
33connection.RemoteIpAddress = IPAddress.IPv6Loopback;
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
371ctx.Connection.RemoteIpAddress = IPAddress.IPv6Any;
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
Infrastructure\TestHelpers.cs (1)
30httpContext.Connection.RemoteIpAddress = IPAddress.Parse("127.0.0.1");
JsonTranscodingServerCallContextTests.cs (1)
67httpContext.Connection.RemoteIpAddress = IPAddress.Parse("127.0.0.1");
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
779context.Connection.RemoteIpAddress = IPAddress.IPv6Any;
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
323connection.RemoteIpAddress = currentValues.RemoteIpAndPort.Address;
Microsoft.AspNetCore.HttpOverrides.Tests (5)
ForwardedHeadersMiddlewareTest.cs (5)
77c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); 135c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); 173c.Connection.RemoteIpAddress = IPAddress.Parse(originalIp); 246c.Connection.RemoteIpAddress = IPAddress.Parse("10.0.0.1"); 879c.Connection.RemoteIpAddress = IPAddress.Parse(remoteIp);
Microsoft.AspNetCore.Rewrite.Tests (5)
PatternSegments\IsIPV6SegmentTests.cs (3)
18context.HttpContext.Connection.RemoteIpAddress = null; 33context.HttpContext.Connection.RemoteIpAddress = IPAddress.Parse("2001:0db8:85a3:0000:0000:8a2e:0370:7334"); 48context.HttpContext.Connection.RemoteIpAddress = IPAddress.Parse("20.30.40.50");
PatternSegments\RemoteAddressSegmentTests.cs (2)
18context.HttpContext.Connection.RemoteIpAddress = IPAddress.Parse("20.30.40.50"); 31context.HttpContext.Connection.RemoteIpAddress = null;
Microsoft.AspNetCore.TestHost.Tests (1)
ClientHandlerTests.cs (1)
270context.Connection.RemoteIpAddress = IPAddress.Parse("1.1.1.1");
40 references to RemoteIpAddress
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
29await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine);
AzureAppServicesSample (1)
Startup.cs (1)
40await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine);
DefaultBuilder.SampleApp (1)
Startup.cs (1)
30await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + "\r\n");
HttpOverridesSample (1)
Startup.cs (1)
27await context.Response.WriteAsync($"RemoteIP: {context.Connection.RemoteIpAddress}\r\n");
IISSample (1)
Startup.cs (1)
54await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine);
InProcessWebSite (3)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (3)
182if (context.Connection.LocalIpAddress == null || context.Connection.RemoteIpAddress == null) 370Assert.True(IPAddress.IsLoopback(ctx.Connection.RemoteIpAddress)); 372Assert.Equal(IPAddress.IPv6Any, ctx.Connection.RemoteIpAddress);
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
1947remoteAddress = context.Connection.RemoteIpAddress;
Kestrel.SampleApp (1)
Startup.cs (1)
54logger.LogDebug($"Peer: {connectionFeature.RemoteIpAddress?.ToString()}:{connectionFeature.RemotePort}"
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Internal\JsonTranscodingServerCallContext.cs (5)
83if (connection.RemoteIpAddress != null) 85switch (connection.RemoteIpAddress.AddressFamily) 88return $"ipv4:{connection.RemoteIpAddress}:{connection.RemotePort}"; 90return $"ipv6:[{connection.RemoteIpAddress}]:{connection.RemotePort}"; 93return $"unknown:{connection.RemoteIpAddress}:{connection.RemotePort}";
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
828Assert.Equal(IPAddress.IPv6Any, connectionHttpContext.Connection.RemoteIpAddress);
Microsoft.AspNetCore.HttpLogging (2)
W3CLoggingMiddleware.cs (2)
104shouldLog |= AddToList(elements, _clientIpIndex, connectionInfo.RemoteIpAddress is null ? "" : connectionInfo.RemoteIpAddress.ToString());
Microsoft.AspNetCore.HttpOverrides (4)
ForwardedHeadersMiddleware.cs (4)
212RemoteIpAndPort = connection.RemoteIpAddress != null ? new IPEndPoint(connection.RemoteIpAddress, connection.RemotePort) : null, 307if (connection.RemoteIpAddress != null) 310requestHeaders[_options.OriginalForHeaderName] = new IPEndPoint(connection.RemoteIpAddress, connection.RemotePort).ToString();
Microsoft.AspNetCore.HttpOverrides.Tests (11)
ForwardedHeadersMiddlewareTest.cs (11)
43Assert.Equal("11.111.111.11", context.Connection.RemoteIpAddress.ToString()); 81Assert.Equal(expectedIp, context.Connection.RemoteIpAddress.ToString()); 139Assert.Equal(expectedIp, context.Connection.RemoteIpAddress.ToString()); 179Assert.Equal("10.0.0.1", context.Connection.RemoteIpAddress.ToString()); 187Assert.Equal(originalIp, context.Connection.RemoteIpAddress.ToString()); 250Assert.Equal(expectedIp, context.Connection.RemoteIpAddress.ToString()); 280Assert.Null(context.Connection.RemoteIpAddress); 924Assert.Equal("11.111.111.11", context.Connection.RemoteIpAddress.ToString()); 959Assert.Null(context.Connection.RemoteIpAddress); 992Assert.Equal("11.111.111.11", context.Connection.RemoteIpAddress.ToString()); 1045Assert.Equal(expectedRemoteIp, context.Connection.RemoteIpAddress.ToString());
Microsoft.AspNetCore.Rewrite (3)
PatternSegments\IsIPV6Segment.cs (2)
12if (context.HttpContext.Connection.RemoteIpAddress == null) 16return context.HttpContext.Connection.RemoteIpAddress.AddressFamily == AddressFamily.InterNetworkV6 ? "on" : "off";
PatternSegments\RemoteAddressSegment.cs (1)
10return context.HttpContext.Connection.RemoteIpAddress?.ToString();
NativeIISSample (1)
Startup.cs (1)
48await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine);
Sockets.FunctionalTests (2)
SocketTransportTests.cs (1)
41Assert.Equal(ip.Address, context.Connection.RemoteIpAddress);
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (1)
1108RemoteIPAddress = connection.RemoteIpAddress?.ToString(),
SystemdTestApp (1)
Startup.cs (1)
28logger.LogDebug($"Peer: {connectionFeature.RemoteIpAddress?.ToString()}:{connectionFeature.RemotePort}"