Hi,
How can I obtain the client Ip if my SMPP Servers runs under the proxy?
_client.RemoteEndPoint is obtaining the proxy IP.
Obtain the client IP over the proxy
Re: Obtain the client IP over the proxy
Does the Proxy supports Proxy protocol https://www.haproxy.com/blog/haproxy/proxy-protocol/ ?
Re: Obtain the client IP over the proxy
Hello alt,alt wrote: ↑Fri Apr 14, 2023 10:13 amDoes the Proxy supports Proxy protocol https://www.haproxy.com/blog/haproxy/proxy-protocol/ ?
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.
- Attachments
-
- SMPP_wireshark
- SMPP_wireshark.png (196.3 KiB) Viewed 16975 times
Re: Obtain the client IP over the proxy
You need to enable ProxyProtocolEnabled for the client in the handler method for the event evClientConnected
after that the RemoteEndPoint of the client returns the IP address behind the proxy.
Code: Select all
smppServer.evClientConnected += (sender, client) =>
{
client.ProxyProtocolEnabled = true;
};