>
The problem with the question is: if the client managed to connect to
the web server, why does it need to ask for an address? A cgi-bin
to figure out a local address to send back to the client that's
already connected to it is somewhat pointless.
It isn't pointless because you're assuming those addresses are the
same, and that's a very bad assumption because of NAT. In fact,
there are several web servers that offer the opposite service-- you
connect, and they say "you came from THIS address." If the client
is behind a NAT box, the reported address may or may not be different
than what your local machine thinks its own address is. In fact, if
you need to register a "client" with a dynamic DNS service or something
like that, an external reverse probe like this is essential to getting
the correct globally-routed address.
I'm not sure what the original poster is trying to do, but I assume
they know what they are doing.