You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
When running an https server with express, I noticed that when I lit up a logger and tried to print the remoteAddress, it was printing 'undefined'. After some investigation, I found that the socket object in the request was missing the remoteAddress property. I also found that req.socket had a socket property as well.
To work around this for logging purposes, I just added my own little middleware function:
However, I think this indicates a larger problem that may affect other code expecting missing properties from the req.socket object within the https module.
Should there be consistency between the servers created with http and https?
The text was updated successfully, but these errors were encountered:
HTTPS uses the TLS module which provides the CleartextStream class. This is a stream implementation with a socket in it. This is why you see this behaviour. It's expected, but I agree it is a little strange. I'm going to mark this as a feature request to get some discussion about it.
When running an https server with express, I noticed that when I lit up a logger and tried to print the remoteAddress, it was printing 'undefined'. After some investigation, I found that the socket object in the request was missing the remoteAddress property. I also found that req.socket had a socket property as well.
To work around this for logging purposes, I just added my own little middleware function:
However, I think this indicates a larger problem that may affect other code expecting missing properties from the req.socket object within the https module.
Should there be consistency between the servers created with http and https?
The text was updated successfully, but these errors were encountered: