Skip to content

Add optional support for unix domain sockets - #119

Open
fenichelar wants to merge 4 commits into
fastify:mainfrom
fenichelar:main
Open

fenichelar wants to merge 4 commits into
fastify:mainfrom
fenichelar:main

Conversation

@fenichelar

Copy link
Copy Markdown

Adds optional support for unix domain sockets. Removes @fastify/forwarded dependency to do so.

Checklist

Signed-off-by: Alec Fenichel <alec.fenichel@transnexus.com>
Signed-off-by: Alec Fenichel <alec.fenichel@transnexus.com>
Signed-off-by: Alec Fenichel <alec.fenichel@transnexus.com>
Signed-off-by: Alec Fenichel <alec.fenichel@transnexus.com>
@Tony133
Tony133 requested a review from a team October 13, 2026 13:24
Comment thread README.md
```

### proxyaddr(req, trust)
### proxyaddr(req, trust, uds)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% convinced that a new parameter should be added; why not included within the trust one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking this would help clarify the distinction between this and regular trust. When an IP address is trusted that trust applies in the socket and in the X-Forwarded-For header. When UDS is set, it signals to the function that the socket address is expected to be undefined and that the first IP address in the X-Forwarded-For header is the starting point.

That being said, happy to change it to use the trust parameter if that is preferable. Any suggestions on what to put in the trust parameter to indicate unix domain sockets are being used?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See your point; agree that it will be better to keep it separate. Maybe we can create a new opts object that has this property. In that way is a bit more explicit than a positional argument, and if more flags start to being added, we can also add it to that baggage without requiring to adjust positional args.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants