Multiuser Lingo Dictionary > Multiuser Lingo Dictionary > getNetAddressCookie()

 

getNetAddressCookie()

Syntax

gMultiuserInstance.getNetAddressCookie({encryptFlag} {, whichIPAddress})

Description

Multiuser Server Lingo function; returns a network address cookie for the current machine. By default, the returned string is an encrypted string containing the local computer's IP address.

The getNetAddressCookie() function lets Lingo work with the local IP address without knowing the actual address. This is a security precaution to prevent movies being run by an end user behind a firewall from determining the address of the end user's computer.

The cookie's contents are "MacromediaSecretIPAddressCookie <encrypted IP address>". This value can be passed over the network to another computer, which can then use it as the server address for connectToNetServer().

This is a typical scenario when you meet another user or users on a server and want to create a peer-to-peer connection without revealing your IP address. You can send an encrypted address to the other users and then wait for the other users by using waitForNetConnection.

If the optional encryptFlag parameter is set to 0, the returned string looks like a regular IP address, such as 123.45.67.1. This unencrypted address information is not available when movies are playing in Shockwave or if the safePlayer movie property is set to TRUE.

The second optional parameter lets you specify which IP address you want to return when the client machine is using multiple IP addresses. If you specify an index of 2, the second IP address on the machine will be returned.

Example

This statement sets the variable myLocalAddress to the third IP address on the client machine in unencrypted format:

myLocalAddress = gMultiuserInstance.getNetAddressCookie(0, 3)

See also

connectToNetServer(), waitForNetConnection(), getUserIPAddress