[squid-users] Any way to get the client's connecting port number?

Russel McDonald russel_mcdonald at swbell.net
Wed Feb 27 21:22:10 UTC 2019


Hi, is there any way to get the port number of the connecting client available to the adapter through ECAP interface? Not just the IP but the port number as well. I found that I can do that by a tiny change but it has to be int he squid source:In adaptation\ecap\XActionRep.cc, method clientIpValue:I added the sprintf:sprintf(&ntoabuf[strlen(ntoabuf)], ":%d", client_addr.port());            return libecap::Area::FromTempBuffer(ntoabuf, strlen(ntoabuf));
The adapter then has access to the client's connecting port. I use that information to then look up the PID of the connecting process and hence user, using a Windows dll and method with increased privs.
So is there any existing way to get that port without a squid change? And if not then would the team be amenable to my joining as a dev contributor and submitting that? It could be as a separate value/option so as to not break any existing apps relying on that particular string just having the IP.
Russel McDonald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20190227/6da25550/attachment.html>


More information about the squid-users mailing list