Specifications

CHAPTER 3
46
Flash Player also provides support for versions of RTMP that are tunneled through HTTP and HTTPS. RTMP
refers to RTMP transmitted within an HTTP wrapper, and RTMPS is RTMP transmitted within an HTTPS
wrapper.
Using sockets
Sockets let you read and write raw binary or XML data with a connected server. Sockets transmit over TCP.
Because of this, Flash Player cannot take advantage of the built-in encryption capabilities of the browser. However,
you can use encryption algorithms written in ActionScript to protect the data that is being communicated.
Cross-domain access to socket and XML socket connections is disabled by default. Access to socket connections
in the same domain of the SWF file on ports lower than 1024 is also disabled by default. You can permit access to
these connections by serving a cross-domain policy file from any of the following locations:
The same port as the main socket connection
A different port
The HTTP server on port 80 in the same domain as the socket server
For more information, see the Socket and XMLSocket classes in Flash ActionScript Language Reference.
Using the LocalConnection class
The LocalConnection class lets you develop SWF files that can send instructions to each other. LocalConnection
objects can communicate only among SWF files that are running on the same client computer, but they can be
running in different applications—for example, a SWF file running in a browser and a SWF file running in a
projector. (A projector is a SWF file saved in a format that can run as a stand-alone application—that is, the
projector doesnt require Flash Player to be installed since it is embedded inside the executable file.)
For every LocalConnection communication, there is a sender SWF file and a listener SWF file. The simplest way
to use a LocalConnection object is to allow communication only between LocalConnection objects located in the
same domain because you won’t have security issues.
Applications served from different domains that need to be able to make LocalConnection calls to each other
must be granted cross-domain LocalConnection permissions. To do this, the listener must allow the sender
permission by using the
LocalConnection.allowDomain() or LocalConnection.allowInsecureDomain()
methods.
Adobe does not recommend using the LocalConnection.allowInsecureDomain() method because allowing
non-HTTPS documents to access HTTPS documents compromises the security offered by HTTPS. It is best that
all Flash SWF files that make LocalConnection calls to HTTPS SWF files are served over HTTPS.