Share this page

# lr.getVuserIp

Returns the IP address of a Vuser.

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

Copy code

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

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

    return 0;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: