diff --git a/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs b/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs index 729480b..f25b0c6 100644 --- a/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs +++ b/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs @@ -2,6 +2,8 @@ using Microsoft.Extensions.Logging; using System; using System.ComponentModel; +using System.Net; +using System.Net.Sockets; using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; @@ -53,7 +55,14 @@ namespace FastGithub.PacketIntercept.Tcp throw new Win32Exception(); } - this.logger.LogInformation($"tcp://localhost:{this.oldServerPort} => tcp://localhost:{this.newServerPort}"); + if (Socket.OSSupportsIPv4) + { + this.logger.LogInformation($"{IPAddress.Loopback}:{this.oldServerPort} <=> {IPAddress.Loopback}:{this.newServerPort}"); + } + if (Socket.OSSupportsIPv6) + { + this.logger.LogInformation($"{IPAddress.IPv6Loopback}:{this.oldServerPort} <=> {IPAddress.IPv6Loopback}:{this.newServerPort}"); + } cancellationToken.Register(hwnd => WinDivert.WinDivertClose((IntPtr)hwnd!), handle); var packetLength = 0U;