Yet another thing that could be done by interceptors ("filters"):
http://aeolus.cit.cornell.edu/xmlrpc/xmlrpc.html Aaron Hamid On 29 Mar 2002 [EMAIL PROTECTED] wrote: > rpc-dev Digest 29 Mar 2002 18:19:05 -0000 Issue 52 > > Topics (messages 468 through 468): > > IP Address of Connecting Client in RPC Handlers of WebServer? > 468 by: Chris Kay > > Administrivia: > > To subscribe to the digest, e-mail: > [EMAIL PROTECTED] > > To unsubscribe from the digest, e-mail: > [EMAIL PROTECTED] > > To post to the list, e-mail: > [EMAIL PROTECTED] > > > ---------------------------------------------------------------------- > Date: Thu, 28 Mar 2002 06:33:27 +0100 > To: <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> > From: "Chris Kay" <[EMAIL PROTECTED]> > Subject: IP Address of Connecting Client in RPC Handlers of WebServer? > Message-ID: <001501c1d61a$16be5270$ddbfe6d9@kane> > > Hi everyone! > > Not sure if this ever came up before, but I was wondering if there is any > way a registered RPC handler could find out from its WebServer the IP > address of the connecting client requesting RPC? > > I've looked through the code a bit and, apparently, in WebServer.java, > method run(), the Socket from serverSocket.accept() is retrieved which > should contain the client's IP address (method Socket.getInetAddress()). > However, the Socket is just passed on to the thread mechanism which, > eventually and ignoring any such information, will invoke a registered > handler's fitting RPC method, while the WebServer will be ready again to > accept other incoming requests. Obviously, the latter means storing the IP > in the WebServer doesn't work as other requests might have come in before a > finally invoked RPC method of a handler for a previous request queries the > stored IP. > > Is there any way that the threads could carry on such information and make > it somehow available to the handlers? Or better yet, am I just too blind to > see the obvious, already working solution? :o) > > To sum up, it's the connecting client's IP that I am interested in, not the > local WebServer's IP (which I assume can be queried from the stored > serverSocket if one extends the WebServer class). A solution where one > naively expects an RPC client to send its own IP as an argument with the RPC > request is not desirable as it could easily be faked. > > Thanks for any help! > > Cheers, Chris > > PS: My apologies if messages should not be posted to both mailing lists. But > I just couldn't decide which of the two is the more suitable one. > > ------------------------------ > > End of rpc-dev Digest > *********************************** >