Repository navigation
Add optional support for unix domain sockets - #119
fenichelar wants to merge 4 commits into
Conversation
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>
| ``` | ||
|
|
||
| ### proxyaddr(req, trust) | ||
| ### proxyaddr(req, trust, uds) |
There was a problem hiding this comment.
Not 100% convinced that a new parameter should be added; why not included within the trust one?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Adds optional support for unix domain sockets. Removes
@fastify/forwardeddependency to do so.Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct