Closed akc42 closed 8 years ago
I have been doing some digging, and I think the problem arises because serve-static
uses send
which in turn uses on-finished
. This is expecting the response stream to have a boolean finished
field. When I use the http2 module the response stream that gets passed is outgoingMessage
when I use the https module the response stream that gets passed is serverResponse
which is something derived from outgoingMessage
this has the additional boolean.
I am not sure I yet understand about this additional field yet and why on-finished needs to use it. So more digging
I think my previous message is a bit confused. What I now understand is that OutgoingResponse
is http2
's equivalent of 'ServerResponse. However it is missing the
finished` boolean that that spec calls for.
I tried patching it in = this.finished = false
in the constructor and this.finished = true
in the _finish()
function and I appear to be my test system working. No idea if that is the right solution, so no pull request.
I am trying to make an http2 server work, and all that happens is my initial static file request remains pending when using serve-static. The identical code works when I replace require('http2') with require('https'), so I assume it is worth reporting as the goal is compatability. I am running on linux with node v5.0.0 and chrome as the browser version 47.0.2526.106
Here is the core of my code - first most of the requires
then the inside of the function creating the web server I can replace require('http2') with require('https') in the first line below and it all works perfectly.
The certificates in use (passed in as the cert parameter in the first position of CreateServer) are from letsEncrypt, and refer to a real ip address from the outside, but I have tweeked by internal dns server to point the hostname (pastrial.hartley-consultants.com) to my development machine. So I make a browser request for https://pastrial.hartley-consultants.com:5443 and with http2 this never completes - yet with https it completes (and all the followup requests too).
index.html is a real file within PROJECT_ROOT/app/