Kerry Jiang
Kerry Jiang
Yes, haven't pushed the latest package to nuget. Please help me confirm if this feature can work. I will push a new version to nuget ASAP. @alberk8
Try this instead. ``` .UsePackageHandler(async (session, package) => { Console.WriteLine($"Server EndPioint {((IPEndPoint)session.LocalEndPoint).Address.ToString()} Client EndPoint {((IPEndPoint)session.RemoteEndPoint).Address.ToString()} "); } ```
If you want to access the original destination endpoint, you can use the statement below: ``` session.Connection.ProxyInfo.DestinationIPAddress; or session.Connection.ProxyInfo.DestinationEndPoint; ```
> I have tested and it looks like the Server EndPoint IP is in **reverse order.** The Server Endpoint should read 192.168.2.15 The Client IP 172.27.0.3 is the IP of...
That means the addresses (at least ipv4) are read in reverse order.
Pushed one fix.
Probably reversing bytes for ipv6 is not necessary because original bytes are taken directly. But I will do further confirming. Do you mean ProxyInfo.SourceIPAddress and ProxyInfo.DestinationIPAddress are same?
I am working on more unit tests and already noticed the problem of ipv6.
> One more thing. if I call the `session.Connection.ProxyInfo.SourceIPAddress` when the enableProxyProtocol is not set it will throw a null reference. Can this not throw? Can you use session.RemoteEndPoint.Address? That...
@alberk8 @AsenLins I think I have fixed the problem of ipv6 just now.