JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.getVuserIp

lr.getVuserIp

Returns the IP address of a Vuser.

Example Informational Functions

Syntax

lr.getVuserIp( ); 

The lr.getVuserIp function returns the IPv4 address of a Vuser. When performing IP spoofing, each Vuser can use a different address. This function allows you to determine the current Vuser's IP address.

If the IP was set with the web.setSocketsOption function using the IP_ADDRESS_BY_INDEX option, lr.getVuserIp returns that IP.

To get an IPv6 address, use lr.getAttribString("ipv6") .

Return Values

The IP address of the Vuser. On failure, or if working with multiple IP addresses is disabled, returns NULL.

Parameterization

Parameterization is not applicable to this function.

Example

function Action(){
   var ip = lr.getVuserIp();

   if (ip)
        lr.outputMessage("The IP address is "+ ip);
   else
        lr.outputMessage("IP spoofing disabled");
        
return 0;
}