[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/ssr/node/createWebRequestFromNodeRequest [Back]  [Original]

createWebRequestFromNodeRequest Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/ssr/node

createWebRequestFromNodeRequest

function

Converts a Node.js IncomingMessage or Http2ServerRequest into a Web Standard Request object.

On this page

    arrow_upward_alt Back to the top

    API

    function createWebRequestFromNodeRequest(
      nodeRequest: IncomingMessage | Http2ServerRequest,
      trustProxyHeaders?: boolean | readonly string[] | undefined,
    ): Request;
    @paramnodeRequestIncomingMessage | Http2ServerRequest
    • The Node.js request object (IncomingMessage or Http2ServerRequest) to convert.
    @paramtrustProxyHeadersboolean | readonly string[] | undefined
    • A boolean or an array of proxy headers to trust when constructing the request URL.
    @returnsRequest

    A Web Standard Request object.

    Description

    Converts a Node.js IncomingMessage or Http2ServerRequest into a Web Standard Request object.

    This function adapts the Node.js request objects to a format that can be used by web platform APIs.

    Usage Notes

    When trustProxyHeaders is enabled, headers such as Forwarded, X-Forwarded-Host, and X-Forwarded-Prefix should ideally be strictly validated at a higher infrastructure level (e.g., at the reverse proxy or API gateway) before reaching the application.

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page