The JavaScript function you want may not be visible outside of the FindProxyForURL(url, host) function you can use:
myAddress = myIpAddress();
So far, there seems to be no good way of returning this to the web host you are going to (proper sand-boxing). Is this what you needed?