spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

Error: Got RST: PROTOCOL_ERROR #266

Closed BenWildeman closed 7 years ago

BenWildeman commented 7 years ago

When ever I try to push an image or font, the first time loads fine, but on refresh get the following error:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Got RST: PROTOCOL_ERROR
    at Stream._handleRST (C:\Users\aileen\plug-pls\node_modules\spdy\node_modules\spdy-transport\lib\spdy-transport\stream.js:280:24)
    at Stream._handleFrame (C:\Users\aileen\plug-pls\node_modules\spdy\node_modules\spdy-transport\lib\spdy-transport\stream.js:126:10)
    at Connection._handleFrame (C:\Users\aileen\plug-pls\node_modules\spdy\node_modules\spdy-transport\lib\spdy-transport\connection.js:327:12)
    at Parser.<anonymous> (C:\Users\aileen\plug-pls\node_modules\spdy\node_modules\spdy-transport\lib\spdy-transport\connection.js:161:10)
    at emitOne (events.js:96:13)
    at Parser.emit (events.js:188:7)
    at readableAddChunk (C:\Users\user\project\node_modules\spdy\node_modules\spdy-transport\node_modules\readable-stream\lib\_stream_readable.js:210:18)
    at Parser.Readable.push (C:\Users\user\project\node_modules\spdy\node_modules\spdy-transport\node_modules\readable-stream\lib\_stream_readable.js:169:10)
    at Parser.Transform.push (C:\Users\user\project\node_modules\spdy\node_modules\spdy-transport\node_modules\readable-stream\lib\_stream_transform.js:123:32)
    at next (C:\Users\user\project\node_modules\spdy\node_modules\spdy-transport\lib\spdy-transport\protocol\base\parser.js:52:12)

setup:

spdy.createServer(options, (req, res) => {
    if (req.url === "/") {
        if (req.isSpdy) {
            var stream = res.push("/fonts/some-font.woff", {
                method: "GET",
                request: {
                    accept: "*/*"
                },
                response: {
                    "content-type": "application/font-woff",
                    "content-encoding": "gzip"
                }
            });
            stream.on("err", function (err) {
                console.log(err);
            });
            fs.createReadStream("./public/fonts/some-font.woff")
            .pipe(zlib.createGzip())
            .pipe(stream);
        }
        res.end(htmlFile);
    }
}).listen(8080);
indutny commented 7 years ago

Hello! I'm afraid that the error name is error, not err. This is why your app is crashing. Sorry!

BenWildeman commented 7 years ago

I have changed it to error. is there a way to stop it from giving the Error: Got RST: PROTOCOL_ERROR ? I don't want it to fill the logs up every time a user requests the index.html

zliebersbach commented 7 years ago

@indutny I can reproduce this issue. It seems to happen after the connection is not used for a while, and a request is sent.

FlorianKoerner commented 6 years ago

Agree with @wincinderith. Made the same observations.

RezaErfani67 commented 3 years ago

not resolved for me... image