The following technique was pointed to me by DanBUK. Dan managed to find the internal IP address of the visiting client by establishing a socket between local host and the remote web server. Upon success the socket populates its structure with all kinds of useful stuff among some of which are the internal NATed IP address and the hostname.
The source code can be downloaded from here. [...]