http2-push-example
http2-push-example copied to clipboard
HTTP/2 Push example
``` $ node -v v17.2.0 $ npm -v 8.5.1 $ npm start > [email protected] start > node --expose-http2 index.js node: bad option: --expose-http2 ```
I was getting the following error: ``` ...\http2-push-example\src\server.js:28 pushStream.respondWithFD(file.fileDescriptor, file.headers) ^ TypeError: Cannot read property 'respondWithFD' of null at stream.pushStream (...\http2-push-example\src\server.js:28:16) at process._tickCallback (internal/process/next_tick.js:63:19) ``` [Apparently](https://github.com/nodejs/node/issues/18490) the [HTTP2 API](https://github.com/nodejs/node/pull/17406#issuecomment-356661798) of...
stream.pushStream({ ':path': path }, (err,pushStream) => { }) 先err再pushStream
Simple fix, although trivially also raises the required version of Node.
helper.js node v8.10 
I found in `helper.js`, we open the file to get the `fileDescriptor` using `fs.openSync(filePath, 'r')`. But do we need to close it when the server is closed? the code in...