Conversation
On the changes, besides the mentioned above, I changed `remoteAddress` and `remotePort` to `sourceAddress` and `sourcePort` respectively, which seemed to be more related to the original spec. Then I added `destinationAddres` and `destinationPort`.
|
@daguej I think this is a lot cleaner, please review. There are two end of lines that I don't know how to put away from the commits :/ Any recommendation is appreciated! |
|
Thanks, this is much clearer. :)
The original goal of this module was to be a drop-in wrapper of node's native In other words, let's assume an application is written to run on a single server. So to get the end-user IP address, it simply gets the address from Ideally, an author needs only wrap a net module with this module, and everything else "just works," no code changes required. That is, code written expecting the real client IP in I like this approach since it is very low friction (requiring changing only two lines of code in an existing app), and I don't think anyone would need the 'physical' remoteAddress (that of the ELB). So currently:
To be logically consistent, it seems like it might be most appropriate to replace However, I'm torn between that and creating a new, third property ( |
|
Thanks a lot for the reply. I like the way you make it as a direct drop-in replacement, however, the destination variables are indeed useful, in whichever form you'd like to include them. One way would be to provide a PROXY variable which could have all the PROXY-specific values in the right order, for example? That way, even if it's a clean replacement, it could provide the original information almost as received? |
On the changes, besides the mentioned above, I changed
remoteAddressandremotePorttosourceAddressandsourcePortrespectively, which seemed tobe more related to the original spec. Then I added
destinationAddresanddestinationPort.