Skip to content

Regression on Fastify V5.8.3 with trustProxy: 1 for Windows IISNODE servers #6606

@Orel-A

Description

@Orel-A

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.8.3

Plugin version

No response

Node.js version

20.x

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

Microsoft Windows Server 2022

Description

req.ip is not filled, getting undefined.
for Windows servers which mostly run with Plesk and IISNODE the web.config is configured with <iisnode enableXFF="true"/> in order to get the IP address of the visitor.
and in Fastify the instance is created with trustProxy: 1, setting to true won't be good because IISNODE appends user's X-Forwarded-For so it can be spoofed. So setting to 1 is the correct method.
but after version 5.8.3, the req.ip variable is undefined!
help is appreciated.

Link to code that reproduces the bug

Not sure how to do this

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions