isInNet() (Function/proxy.pac)

This is a convenience function for use with proxy.pac files.


JavaScript - 1.2
Netscape - 4.0
JavaScript syntax:NisInNet(aHostname, aSubNet)
Argument list:aHostnameA host name whose IP address is compared with the sub-net
aSubNetA sub-net to test against the host IP address

This function performs a name to IP translation by means of an IP lookup. This involves connecting to a name server and waiting for its reply. This is not something you will want to do often as it can severely affect your performance.

Once the host IP address is known, it can be checked against the sub-net value and a true or false value returned.

The value true is returned if the host is a valid member of the sub-net and false if it is part of another sub-net.

See also:FindProxyForURL(), isPlainHostName(), Proxies, proxy.pac


Wrox Instant JavaScript - page - 58