Unix socket support
Hi!
When using an unix socket instead of a tcp port req.connection.remoteAddress is undefined. And forwarded adds that undefined value to the array of forwarded IPs (https://github.com/jshttp/proxy-addr/blob/master/index.js#L57). So given that undefined is not a valid ip https://github.com/jshttp/proxy-addr/blob/master/index.js#L254 returns false for the index 0 and so no IP is trusted.
If are you willing to accept a PR to solve this issue, I can offer to write it: for example considering undefined the loopback address or adding an special option for that case.
Thanks!
Yea, that's what I'm thinking: to maybe just consider the UNIX socket to be the loopback address. It's probably better solved in the forwarded module, maybe. Since a TCP/IP socket in Node.js cal also return undefined for req.connection.remoteAddress, simply assuming that undefined means socket is not really enough to know that for sure.
Hi! :wave: I believe this issue was fixed in the forwarded module in 0.2.0, which was pulled into this module in https://github.com/jshttp/proxy-addr/commit/97965bd99bca059007db448d12c9f82a8fcac879? Maybe this issue can be closed.
(For posterity, I think this commit fixed the problem: https://github.com/jshttp/forwarded/commit/63a16a6e3f0f587dbc5f9eb5a584b19524af3c11)