Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

req.connection is deprecated #8

Closed
silverwind opened this issue Oct 7, 2020 · 3 comments
Closed

req.connection is deprecated #8

silverwind opened this issue Oct 7, 2020 · 3 comments

Comments

@silverwind
Copy link

req.connection is deprecated since Node 13.0.0. req.socket should be used instead (it's available since Node 0.3.0).

var socketAddr = req.connection.remoteAddress

@al-bglhk
Copy link

al-bglhk commented Jan 8, 2021

Thank you for the fix! I am hitting the same warning from the logs. When will this fix be released?

@dougwilson
Copy link
Contributor

Thanks for this issue, and sorry I was not subscribed to this module's notifications.

I see no issue with reading the new property, but I am a little afraid about modules on npm that are trying to overwrite the ip or mock http may end up having an issue once this is merged.

I am thinking about the impact to the use in Express, so it may extend to other things using this.

So I'm wondering if it would be possible to keep reading both values or something. I will try to research into what the mocks and such are doing at least in the Express ecosystem to assess the impact of switching to a new property, but anyone is welcome to post an assessment as well.

No assessment on the impact has been provided so far, so I will try to do it this weekend since Node.js has deprecated the property used here.

Is the current impact that users of the current Node.js version get warnings or is this just to get it fixed before that happens?

@silverwind
Copy link
Author

According to https://nodejs.org/api/deprecations.html#deprecations_dep0149_http_incomingmessage_connection it is doc-only deprecation but it did log warnings in 13.0.0 at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants