Page 1 of 1
Obtain the client IP over the proxy
Posted: Thu Apr 13, 2023 6:45 am
by owlboo98
Hi,
How can I obtain the client Ip if my SMPP Servers runs under the proxy?
_client.RemoteEndPoint is obtaining the proxy IP.
Re: Obtain the client IP over the proxy
Posted: Fri Apr 14, 2023 10:13 am
by alt
Re: Obtain the client IP over the proxy
Posted: Tue Apr 09, 2024 3:01 pm
by didimo
Hello alt,
We are in the same situation as owlboo98. Our SMPPserver solution is deployed with HAProxy and proxy protocol enabled. Our goal is also obtain source IP without NAT (transparent IP) and without use TPROXY at HAProxy.
When trying to connect using SMPPClient with SSL, SMPP_server service is returning
Generic_nack, Status: "Command length is invalid"
Should we change something in SMPP_server code to support proxy-protocol or other related feature to obtain source IP address?
Thanks in advance for your help.
Re: Obtain the client IP over the proxy
Posted: Wed Apr 24, 2024 4:47 pm
by alt
You need to enable
ProxyProtocolEnabled for the client in the handler method for the event
evClientConnected
Code: Select all
smppServer.evClientConnected += (sender, client) =>
{
client.ProxyProtocolEnabled = true;
};
after that the
RemoteEndPoint of the client returns the IP address behind the proxy.