This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
https server / req.socket.socket #758
Labels
Comments
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. |
@ry @bnoordhuis - Can you review? |
@koichik: LGTM |
@bnoordhuis - Thanks, merging. |
@fabrizim - Thanks for the report. |
Glad I could help - thanks for looking into it and making things modules more consistent. |
@fabrizim do you have a test case for this? Can you replicate with HEAD? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: