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 }}
Repository navigation
Docs: http.ServerResponse is missing socket and connection fields #12617
http.ServerResponse docs are missing socket and connection fields. Moreover, it should be mentioned that they're nulled after end() so this won't work: resp.end(message, function(){ this.socket.destroy(); } );
Out of curiosity - may I ask what you're trying to do with the socket you get back here? I'm trying to think of cases where using the writableStream methods on the response isn't the right thing to use.
In my case I'm dealing with streaming server that receives one request and then streams data while the connection exists. I keep Response object to write to and I don't need Request object at all. But I still need socket for closing the connection.
http.ServerResponsedocs are missingsocketandconnectionfields. Moreover, it should be mentioned that they're nulled afterend()so this won't work:resp.end(message, function(){ this.socket.destroy(); } );