Web browser should provide this feature

User manual

Web page designers often want to get client's local IP and server IP mainly for the purpose
of identification and authentication.
However, this is not available at the present, so this addon will provide such information only if the user allows.

That's to say, the purpose of this package is to serve the web page,
rather than to serve the user directly though the options setting is for the end user.
Whether the web page wants to utilize the information is another thing.

This addon does not use any external service, no server side stuff.
All are local side stuff.

To web designers:
you had better not to include this into your code.
Instead, you will have to ask your user to install this addon from a third party
such as me. It will be great if web browser can provide this feature,
then this addon is not longer needed.


You can test whether your users have install it.
var installed=window.IP!==undefined;
Otherwise, you will have to suggest them to install it.







window.IP.getClient();
      //will inquiry the user,
      //if the user allows, then return local IP
      //if the user rejects, return "rejected"
      //return null, when the content is from cache.
window.IP.getServer(); //return {IP: serverIP, host: hostname, port:port}
      the hostname is provided for verification purpose.
      it should be same as window.loation.hostname.
      this call does not inquiry the user.
      //return null, when the content is from cache.
window.IP.getBoth();
      //return {IPserver: serverIP, url: hostname, portServer:port, IPlocal: localIP}



window.IP.getProxy();  not implemented
      //will inquiry the user
      //if the user allows, return the local public IP
      //if the user rejects, return null
window.IP.getProxyLocal()  not implemented
      //will inquiry the user
      //if the user allows both: {local:localIP, proxy:local public IP}
      //if either one is rejected, the corresponding field is null.
      //if both are rejected, then both fields are null.