Reputation: 65
Maybe I'm not searching for the correct terms, or maybe this is not something that people usually care about but I simply cannot find out how to get the TCP Port the Client is connecting from.
I have a client that uses a TWebBrowser and an Apache server that has a Delphi WebModule running. The client connects to the URL on port 80 and somewhere in this I need to report on the port that client is using.
At the WebModule end I can collect the IP address of the incoming connection (Request.RemoteAddr) and any variables it sends in a POST body, but I cannot seem to get the port it is originating from.
I have found some explanation of this using Indy but nothing that has helped me to implement something useful at either the client or server end. I'm not sure where to go from here so any suggestions would be welcome.
Upvotes: 1
Views: 287
Reputation: 596031
Sadly, TWebRequest
simply does not expose the client's port, or access to the underlying request/socket needed so you can obtain the client's port manually.
This is a limitation of WebBroker itself, not of Indy (which is one of the available backends that WebBroker can use, via Indy's IdHTTPWebBrowserBridge
unit. Indy has access to the client port, but you don't have access to the Indy HTTP server that WebBrowker uses internally).
Upvotes: 1