Your Search Results

    This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

    This API is available on Firefox OS for privileged or certified applications only.


    The open method is used to open a TCP connection to a given server on a given port.


    var instanceOfTCPSocket =, port[, options]);


    A string representing the host name of the server to connect to.
    A number representing the port to connect to.

    An object specifying the details of the socket. This object expects one or more of the following properties:

    • useSecureTransport: true to create an SSL socket. Defaults to false.
    • binaryType: a string with the value string (default) or arraybuffer. If the latter is used the argument for the send() method must be an ArrayBuffer and the data received from the server will be available as an ArrayBuffer. Otherwise, a string is expected.


    It returns a new TCPSocket object connected to the provided host on the provided port.


    var socket ="", 80);


    Not part of any specification yet; however, this API is discussed at W3C as part of the System Applications Working Group under the Raw Sockets proposal.

    See also

    Document Tags and Contributors

    Contributors to this page: mkato, .vimrc, Jeremie, Andrew Sutherland, kscarfone, teoli
    Last updated by: teoli,