Readonly
URIThe readonly URI corresponding to the protocol connection after any redirections are completed.
Readonly
extensionsSec-Websocket-Extensions response header value
Readonly
httpThe channelId of the underlying http channel. It's available only after nsIWebSocketListener::onStart
The load group of of the websocket
The load info of the websocket
The notification callbacks for authorization, etc..
Readonly
originalURIThe original URI used to construct the protocol connection. This is used in the case of a redirect or URI "resolution" (e.g. resolving a resource: URI to a file: URI) so that the original pre-redirect URI can still be obtained. This is never null.
This value determines how often (in seconds) websocket keepalive pings are sent. If set to 0 (the default), no pings are ever sent.
This value can currently only be set before asyncOpen is called, else NS_ERROR_IN_PROGRESS is thrown.
Be careful using this setting: ping traffic can consume lots of power and bandwidth over time.
This value determines how long (in seconds) the websocket waits for the server to reply to a ping that has been sent before considering the connection broken.
This value can currently only be set before asyncOpen is called, else NS_ERROR_IN_PROGRESS is thrown.
Sec-Websocket-Protocol value
Readonly
securityTransport-level security information (if any)
Unique ID for this channel. It's not readonly because when the channel is created via IPC, the serial number is received from the child process.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Asynchronously open the websocket connection. Received messages are fed to the socket listener as they arrive. The socket listener's methods are called on the thread that calls asyncOpen and are not called until after asyncOpen returns. If asyncOpen returns successfully, the protocol implementation promises to call at least onStop on the listener.
NOTE: Implementations should throw NS_ERROR_ALREADY_OPENED if the websocket connection is reopened.
the uri of the websocket protocol - may be redirected
the uri of the originating resource
attributes of the originating resource.
the inner window ID
the nsIWebSocketListener implementation
an opaque parameter forwarded to aListener's methods
Close the websocket connection for writing - no more calls to sendMsg or sendBinaryMsg should be made after calling this. The listener object may receive more messages if a server close has not yet been received.
the websocket closing handshake close code. Set to 0 if you are not providing a code.
the websocket closing handshake close reason
Similar to the previous one but without nsICookieJarSettings. This method is used by JS code where nsICookieJarSettings is not exposed.
Init the WebSocketChannel with LoadInfo arguments.
reference to the new nsIChannel object
Keep in mind that URIs coming from a webpage should never use the systemPrincipal as the loadingPrincipal.
Please note, if you provide both a loadingNode and a loadingPrincipal, then loadingPrincipal must be equal to loadingNode->NodePrincipal(). But less error prone is to just supply a loadingNode.
These will be used as values for the nsILoadInfo object on the created channel. For details, see nsILoadInfo in nsILoadInfo.idl
Set a nsITransportProvider and negotated extensions to be used by this channel. Calling this function also means that this channel will implement the server-side part of a websocket connection rather than the client-side part.
Generated using TypeDoc
Low-level websocket API: handles network protocol.
This is primarly intended for use by the higher-level nsIWebSocket.idl. We are also making it scriptable for now, but this may change once we have WebSockets for Workers.