Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIHttpChannelInternal

An internal interface for HTTP channels. Using features exposed by this interface is not recommended, as it will change in unpredictable ways.
28
Introduced
Gecko 1.0
Inherits from: nsISupports Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

Method overview

void getRequestVersion(out unsigned long major, out unsigned long minor);
void getResponseVersion(out unsigned long major, out unsigned long minor);
void HTTPUpgrade(in ACString aProtocolName, in nsIHttpUpgradeListener aListener);
void setCookie(in string aCookieHeader);
void setupFallbackChannel(in string aFallbackKey);

Attributes

Attribute Type Description
canceled boolean Returns true if and only if the channel has been canceled. Read only.
channelIsForDownload boolean External handlers may set this to true to notify the channel that it is open on behalf of a download.
documentURI nsIURI An HTTP channel can own a reference to the document URI.
forceAllowThirdPartyCookie boolean Force relevant cookies to be sent with this load even if normally they would not be.
localAddress AUTF8String

The local IP address to which the channel is bound, in the same format produced by PR_NetAddrToString(). This may be either an IPv4 or IPv6 address.

Note: If Network Address Translation (NAT) is in effect, this may not be the same address the remote host thinks it is talking to.
This may throw an NS_ERROR_NOT_AVAILABLE exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsIHttpActivityObserver.isActive attribute is false. See bug 534698 and bug 526207. Read only.
localPort PRInt32

The local port number to which the channel is bound.

This may throw an NS_ERROR_NOT_AVAILABLE exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsIHttpActivityObserver.isActive attribute is false. See bug 534698 and bug 526207. Read only.
proxyInfo nsIProxyInfo Get the proxy info in use by the channel. Read only. Obsolete since Gecko 1.9
remoteAddress AUTF8String

The IP address of the remote host to which this channel is bound, in the same format produced by PR_NetAddrToString().

This may throw an NS_ERROR_NOT_AVAILABLE exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsIHttpActivityObserver.isActive attribute is false. See bug 534698 and bug 526207. Read only.
remotePort PRInt32

The remote port number to which the channel is bound.

This may throw an NS_ERROR_NOT_AVAILABLE exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsIHttpActivityObserver.isActive attribute is false. See bug 534698 and bug 526207. Read only.

Methods

getRequestVersion()

Gets the request's major and minor version numbers.

void getRequestVersion(
  out unsigned long major,
  out unsigned long minor
);
Parameters
major
On return, contains the request's major version number.
minor
On return, contains the request's minor version number.

getResponseVersion()

Gets the response's major and minor version numbers.

void getResponseVersion(
  out unsigned long major,
  out unsigned long minor
);
Parameters
major
On return, contains the response's major version number.
minor
On return, contains the response's minor version number.

Requires Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

HTTPUpgrade()

Allows for the use of HTTP to bootstrap another protocol via the RFC 2616 Upgrade request header in conjunction with a 101 level response. The nsIHttpUpgradeListener will have its nsIHttpUpgradeListener.onTransportAvailable() method invoked if a matching 101 is processed. The arguments to nsIHttpUpgradeListener.onTransportAvailable() provide to the new protocol the low level transport streams that are no longer used by HTTP.

The onStartRequest and onStopRequest events are still delivered and the listener gets full control over the socket if and when nsIHttpUpgradeListener.onTransportAvailable() is delivered.

void HTTPUpgrade(
  in ACString aProtocolName,
  in nsIHttpUpgradeListener aListener
);
Parameters
aProtocolName
The value of the HTTP Upgrade request header.
aListener
The callback object used to handle a successful upgrade.

setCookie()

Helper method to set a cookie with a consumer-provided cookie header, but using the channel's other information (URI's, prompters, date headers and so on.).

void setCookie(
  in string aCookieHeader
);
Parameters
aCookieHeader
The cookie header to be parsed.

Requires Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)

setupFallbackChannel()

Sets up this channel as an application cache fallback channel.

void setupFallbackChannel(
  in string aFallbackKey
);
Parameters
aFallbackKey
The fallback key.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh
 Last updated by: Sheppy,