Last active
June 23, 2017 18:05
-
-
Save matthewp/d5a26ba620fc921754f3ba4892a9b230 to your computer and use it in GitHub Desktop.
spdy crash bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("hello world"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<h1>Hello world!</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var spdy = require("spdy"); | |
var os = require("os"); | |
function getc(pth) { | |
var p = os.homedir() + pth; | |
return fs.readFileSync(p); | |
} | |
var server = spdy.createServer({ | |
key: getc("/.localhost-ssl/private.pem"), | |
cert: getc("/.localhost-ssl/cert.pem"), | |
spdy: { | |
protocols: ["h2", "http/1.1"] | |
} | |
}, onRequest); | |
server.listen(8001); | |
function onRequest(req, res) { | |
for(var i = 1; i <= 51 ;i++) { | |
var f = "/" + i; | |
var s = res.push(f, { | |
request: { accept: '/' }, | |
response: { | |
'content-type': 'application/javascript' | |
} | |
}); | |
s.on('error',function(){}); | |
fs.createReadStream("./app.js",{autoClose:true}).pipe(s); | |
} | |
fs.createReadStream("./index.html",{autoClose:true}).pipe(res); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "node-spdy-break", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"spdy": "^3.4.7" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment