Interface nsIHttpServerIdentityType

Represents a set of names for a server, one of which is the primary name for the server and the rest of which are secondary. By default every server will contain ("http", "localhost", port) and ("http", "127.0.0.1", port) as names, where port is what was provided to the corresponding server when started; however, except for their being removed when the corresponding server stops they have no special importance.

Hierarchy

Properties

primaryHost: string

The primary name by which the corresponding server is known, defaulting to 'localhost'. This name will be the value of nsIHttpRequest.host for HTTP/1.0 requests.

This value is always set when the corresponding server is running. If the server is not running, this value is set only if it has been set to a non-default name using setPrimary. In this case reading this value will throw NS_ERROR_NOT_INITIALIZED.

primaryPort: number

The primary port on which the corresponding server runs, defaulting to the associated server's port. This name will be the value of nsIHttpRequest.port for HTTP/1.0 requests.

This value is always set when the corresponding server is running. If the server is not running, this value is set only if it has been set to a non-default name using setPrimary. In this case reading this value will throw NS_ERROR_NOT_INITIALIZED.

primaryScheme: string

The primary scheme at which the corresponding server is located, defaulting to 'http'. This name will be the value of nsIHttpRequest.scheme for HTTP/1.0 requests.

This value is always set when the corresponding server is running. If the server is not running, this value is set only if it has been set to a non-default name using setPrimary. In this case reading this value will throw NS_ERROR_NOT_INITIALIZED.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Adds a location at which this server may be accessed.

    Throws

    NS_ERROR_ILLEGAL_VALUE if scheme or host do not match the scheme or host productions imported into RFC 2616 from RFC 2396, or if port is not a valid port number

    Parameters

    • scheme: string
    • host: string
    • port: number

    Returns void

  • Returns the scheme for the name with the given host and port, if one is present; otherwise returns the empty string.

    Throws

    NS_ERROR_ILLEGAL_VALUE if host does not match the host production imported into RFC 2616 from RFC 2396, or if port is not a valid port number

    Parameters

    • host: string
    • port: number

    Returns string

  • Returns true if the given name is in this, false otherwise.

    Throws

    NS_ERROR_ILLEGAL_VALUE if scheme or host do not match the scheme or host productions imported into RFC 2616 from RFC 2396, or if port is not a valid port number

    Parameters

    • scheme: string
    • host: string
    • port: number

    Returns boolean

  • Removes this name from the list of names by which the corresponding server is known. If name is also the primary name for the server, the primary name reverts to 'http://127.0.0.1' with the associated server's port.

    Throws

    NS_ERROR_ILLEGAL_VALUE if scheme or host do not match the scheme or host productions imported into RFC 2616 from RFC 2396, or if port is not a valid port number

    Returns

    true if the given name was a name for this server, false otherwise

    Parameters

    • scheme: string
    • host: string
    • port: number

    Returns boolean

  • Designates the given name as the primary name in this and adds it to this if it is not already present.

    Throws

    NS_ERROR_ILLEGAL_VALUE if scheme or host do not match the scheme or host productions imported into RFC 2616 from RFC 2396, or if port is not a valid port number

    Parameters

    • scheme: string
    • host: string
    • port: number

    Returns void

Generated using TypeDoc