nsIHttpUpgradeListener

The callback interface for nsIHttpChannelInternal.HTTPUpgrade; this is called when an HTTP protocol upgrade is finished.
1.0
66
Introduced
Gecko 6.0
Inherits from: nsISupports Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

This is used, for example, by WebSockets in order to upgrade an HTTP channel to use the WebSocket protocol.

Method overview

void onTransportAvailable(in nsISocketTransport aTransport, in nsIAsyncInputStream aSocketIn, in nsIAsyncOutputStream aSocketOut);

Methods

onTransportAvailable()

Called when an HTTP protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer being used by HTTP.

Note: To begin a protocol upgrade, call nsIHttpChannelInternal.HTTPUpgrade().
void onTransportAvailable(
  in nsISocketTransport aTransport,
  in nsIAsyncInputStream aSocketIn,
  in nsIAsyncOutputStream aSocketOut
);
Parameters
aTransport
The nsISocketTransport describing the socket connection between the browser and the server; this socket can now be used for the new protocol instead of HTTP.
aSocketIn
The nsIAsyncInputStream object representing the input stream for data coming from the server over the socket connection.
aSocketOut
The nsIAsyncOutputStream object representing the out stream for sending data to the server over the socket.