Comparing version 3.1.0 to 3.2.0
@@ -231,2 +231,3 @@ 'use strict'; | ||
req.spdyVersion = handle.getStream().connection.getVersion(); | ||
req.spdyStream = handle.getStream(); | ||
@@ -238,2 +239,3 @@ debug('override req/res'); | ||
res.writeContinue = spdy.response.writeContinue; | ||
res.spdyStream = handle.getStream(); | ||
@@ -240,0 +242,0 @@ handle.assignRequest(req); |
{ | ||
"name": "spdy", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Implementation of the SPDY protocol on node.js.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
36
test.js
var spdy = require('./'); | ||
var fs = require('fs'); | ||
var zlib = require('zlib'); | ||
@@ -16,5 +17,36 @@ var options = { | ||
spdy.createServer(options, function(req, res) { | ||
res.end('non-100'); | ||
['/app/main.js'].forEach(function(url){ | ||
console.log('fetching',url); | ||
var stream = res.push(url, { | ||
response: { | ||
'content-type': `${MIME[url.substr(url.lastIndexOf('.')+1)]};charset=utf-8`, | ||
'content-encoding' : 'deflate', | ||
} | ||
}); | ||
stream.on('error', function(er) { | ||
throw er; | ||
}); | ||
var fstream = fs.createReadStream('/tmp'+url); | ||
var zstream = zlib.createDeflate(); | ||
fstream.pipe(zstream).pipe(stream); | ||
}); | ||
setTimeout(function() { | ||
res.end(` | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="/app/main.js" async></script> | ||
<link rel="stylesheet" href="/app/main.css" async> | ||
<link rel="icon" type="image/png" href="/app/favicon-32x32.png" sizes="32x32" async> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body></body> | ||
</html>` | ||
); | ||
}, 500); | ||
}).listen(1443, function() { | ||
console.log(this.address()); | ||
console.log('Listening on %j', this.address()); | ||
}); |
@@ -77,2 +77,4 @@ var assert = require('assert'); | ||
assert.equal(req.spdyVersion, version); | ||
assert(req.spdyStream); | ||
assert(res.spdyStream); | ||
@@ -79,0 +81,0 @@ assert.equal(req.method, 'GET'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62722
1376