@cldn/web-ts - v0.4.0
    Preparing search index...

    Class Request<A>

    An incoming HTTP request from a connected client.

    Type Parameters

    • A
    Index

    Constructors

    Properties

    bodyStream: Readable

    Request body readable stream.

    cookies: ReadonlyMap<string, string>
    headers: Readonly<Headers>

    The request headers.

    ip: IP

    IP address of client (first peer). If the request originated from a trusted proxy, this will be the client IP indicated by the proxy. Otherwise, if the proxy specifies no client IP, or the proxy is untrusted, this will be the proxy IP and equivalent to Request#originalIp.

    method: Method

    The request method.

    originalIp: IP

    The IP address of the request sender (last peer). This might be a proxy.

    originalUrl: Readonly<URL>

    The original request address, as sent by the last peer. The URL protocol is always set to http: and the host (and related) are always taken from the HOST environment variable or defaulted to localhost.

    If basic authentication is available to this request via headers, the username and password fields are available in the URL object.

    pathComponents: readonly string[]

    The components of the request URL path name.

    server: Server<A>

    The Server from which this request was received.

    The address requested by the client (first peer). If the request originated from a trusted proxy, this address will be constructed based on protocol and host provided by the proxy. If the proxy does not specify protocol, http: will be used as a default. If the proxy does not specify host (or the proxy is not trusted), will use the Host request header. If that is not specified either, will use the HOST environment variable or default to localhost.

    In short, this is, as closely as possible, the exact URL address the client requested.

    If basic authentication is available to this request via headers, the username and password fields are available in the URL object.

    Methods

    • Returns a boolean value that declares whether the body has been read yet.

      Returns boolean