ok before someone points me to google or to the search box, let me state that I have already done the searching.
The solutions I get either state using winsock(which happens to be windows only):( or parsing the output of ifconfig(which happens to be linux and maybe unix only):( and further has the problem that if the pc is in a network and traffic is routed through a gateway, ifconfig will give localnetwork address, instead of gateway address.

so my question is there any cross platform way of getting ipaddress of local machine "as seen from the web"?
The ip returned should match that given by whatismyip.com and such sites. Or do I just have to bite the bullet here?