-
Notifications
You must be signed in to change notification settings - Fork 79
http2: request.socket|connection #130
http2: request.socket|connection #130
Conversation
@mcollina Do you mean just replicate that logic in our test, or to actually pull in the |
We need a line that just does this: https://github.com/pillarjs/cookies/blob/master/index.js#L87 |
Okay, I'm just doing a look around for other examples. finalhandler (NPM: 14M/mo)
express (NPM: ∞/mo)
|
https://github.com/pillarjs/finalhandler/blob/master/index.js#L127-L132 cannot be supported as HTTP1 specific. In that specific case for HTTP1, we would have to destroy the stream, not the connection.
|
hapi // Setup timeout
if (this.raw.req.socket &&
this.route.settings.timeout.socket !== undefined) {
this.raw.req.socket.setTimeout(this.route.settings.timeout.socket || 0); // Value can be false or positive
} https://github.com/hapijs/hapi/blob/master/lib/request.js#L344-L350 |
I'm convinced. We need this :). In the test, can you check that whatever |
Added a simple Should I add a test case for HTTPS too? There's not really a difference in core/compat (both are just |
that's fine as it is |
Regarding the hapi setTimeout example... I'm curious why it is necessary actually. In the http/2 case, the |
dd06fb5
to
9f3e375
Compare
@jasnell I suspect it stems from wanting to set different timeouts for specific Hapi routes. See: hapijs/hapi#2195 It would only be possible to apply the timeout once the request has been parsed, not at the initial socket connection listener. Just a guess. |
Yeah, I get that, but given the multiplexing model, and the fact that individual |
Support the socket/connection getter like require('http') does. PR-URL: #130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed as 3904d7c |
Support the socket/connection getter like require('http') does. PR-URL: #130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Support the socket/connection getter like require('http') does. PR-URL: #130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Support the socket/connection getter like require('http') does. PR-URL: nodejs#130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Support the socket/connection getter like require('http') does. PR-URL: nodejs#130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Support the socket/connection getter like require('http') does. PR-URL: nodejs#130 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
As discussed in: #125 (comment)
Adds
request.socket
andrequest.connection
for compatibility with documented HTTP APIs:Use case: I found that popular packages like cookies (NPM: >500k/mo) make use of this to detect the TLS context.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2