I'm not clear on what you mean by
"called from the html page using a image
reference", and this may not apply since you're using
"a simple socket server", but I use the following environment variables from
CGI.pm.
$ENV{'REMOTE_HOST'}
$ENV{'REMOTE_ADDR'}
$ENV{'HTTP_USER_AGENT'}
If this is what you're looking for, more info can be found at http://stein.cshl.org/WWW/software/CGI/.
No mater how you extract this info, it's trivially spoofed, so you shouldn't base any security on what browsers tell you about themselves.
cheers,
ybiC