Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spdy

Package Overview
Dependencies
Maintainers
4
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spdy - npm Package Compare versions

Comparing version 3.4.7 to 4.0.0

1

lib/spdy/server.js

@@ -13,3 +13,2 @@ 'use strict'

var EventEmitter = require('events').EventEmitter
var Buffer = require('safe-buffer').Buffer

@@ -16,0 +15,0 @@ // Node.js 0.8, 0.10 and 0.12 support

20

package.json
{
"name": "spdy",
"version": "3.4.7",
"version": "4.0.0",
"description": "Implementation of the SPDY protocol on node.js.",

@@ -37,20 +37,20 @@ "license": "MIT",

"dependencies": {
"debug": "^2.6.8",
"handle-thing": "^1.2.5",
"debug": "^4.1.0",
"handle-thing": "^2.0.0",
"http-deceiver": "^1.2.7",
"safe-buffer": "^5.0.1",
"select-hose": "^2.0.0",
"spdy-transport": "^2.0.18"
"spdy-transport": "^3.0.0"
},
"devDependencies": {
"istanbul": "^0.4.5",
"mocha": "^3.4.1",
"mocha": "^5.2.0",
"pre-commit": "^1.2.2",
"standard": "^10.0.2"
"standard": "^12.0.1"
},
"engines": [
"node >= 0.7.0"
],
"engines": {
"node": ">=6.0.0",
"npm": ">=6.0.0"
},
"main": "./lib/spdy",
"optionalDependencies": {}
}

@@ -18,3 +18,3 @@ /* eslint-env mocha */

describe('regular', function () {
fixtures.everyConfig(function (protocol, npn, version, plain) {
fixtures.everyConfig(function (protocol, alpn, version, plain) {
var server

@@ -63,4 +63,4 @@ var agent

plain: plain,
protocol: plain ? npn : null,
protocols: [ npn ]
protocol: plain ? alpn : null,
protocols: [ alpn ]
}

@@ -95,4 +95,4 @@ })

}, function (res) {
assert.equal(res.statusCode, 200)
assert.equal(res.headers.a, 'b')
assert.strictEqual(res.statusCode, 200)
assert.strictEqual(res.headers.a, 'b')

@@ -115,4 +115,4 @@ fixtures.expectData(res, 'okay', done)

}, function (res) {
assert.equal(res.statusCode, 200)
assert.equal(res.headers.post, 'headers')
assert.strictEqual(res.statusCode, 200)
assert.strictEqual(res.headers.post, 'headers')

@@ -123,5 +123,5 @@ fixtures.expectData(res, 'post body', done)

agent._spdyState.socket.once(plain ? 'connect' : 'secureConnect',
function () {
req.end('post body')
})
function () {
req.end('post body')
})
})

@@ -136,3 +136,3 @@

}, function (res) {
assert.equal(res.statusCode, 200)
assert.strictEqual(res.statusCode, 200)

@@ -142,4 +142,4 @@ res.resume()

req.on('push', function (push) {
assert.equal(push.path, '/push')
assert.equal(push.headers.push, 'yes')
assert.strictEqual(push.path, '/push')
assert.strictEqual(push.headers.push, 'yes')

@@ -159,6 +159,6 @@ push.resume()

}, function (res) {
assert.equal(res.statusCode, 200)
assert.strictEqual(res.statusCode, 200)
res.on('trailers', function (headers) {
assert.equal(headers.trai, 'ler')
assert.strictEqual(headers.trai, 'ler')
fixtures.expectData(res, 'okay', done)

@@ -173,3 +173,3 @@ })

describe('x-forwarded-for', function () {
fixtures.everyConfig(function (protocol, npn, version, plain) {
fixtures.everyConfig(function (protocol, alpn, version, plain) {
var server

@@ -200,4 +200,4 @@ var agent

plain: plain,
protocol: plain ? npn : null,
protocols: [ npn ]
protocol: plain ? alpn : null,
protocols: [ alpn ]
}

@@ -229,4 +229,4 @@ })

}, function (res) {
assert.equal(res.statusCode, 200)
assert.equal(res.headers['x-forwarded-for'], '1.2.3.4')
assert.strictEqual(res.statusCode, 200)
assert.strictEqual(res.headers['x-forwarded-for'], '1.2.3.4')

@@ -233,0 +233,0 @@ res.resume()

@@ -62,3 +62,3 @@ /* eslint-env mocha */

stream.on('end', function () {
assert.equal(actual, expected)
assert.strictEqual(actual, expected)
callback()

@@ -71,11 +71,11 @@ })

var protocols = [
{ protocol: 'http2', npn: 'h2', version: 4 },
{ protocol: 'spdy', npn: 'spdy/3.1', version: 3.1 },
{ protocol: 'spdy', npn: 'spdy/3', version: 3 },
{ protocol: 'spdy', npn: 'spdy/2', version: 2 }
{ protocol: 'http2', alpn: 'h2', version: 4 },
{ protocol: 'spdy', alpn: 'spdy/3.1', version: 3.1 },
{ protocol: 'spdy', alpn: 'spdy/3', version: 3 },
{ protocol: 'spdy', alpn: 'spdy/2', version: 2 }
]
protocols.forEach(function (protocol) {
describe(protocol.npn, function () {
body(protocol.protocol, protocol.npn, protocol.version)
describe(protocol.alpn, function () {
body(protocol.protocol, protocol.alpn, protocol.version)
})

@@ -86,4 +86,4 @@ })

exports.everyConfig = function everyConfig (body) {
exports.everyProtocol(function (protocol, npn, version) {
if (npn === 'spdy/2') {
exports.everyProtocol(function (protocol, alpn, version) {
if (alpn === 'spdy/2') {
return

@@ -94,3 +94,3 @@ }

describe(plain ? 'plain mode' : 'ssl mode', function () {
body(protocol, npn, version, plain)
body(protocol, alpn, version, plain)
})

@@ -97,0 +97,0 @@ })

@@ -13,9 +13,4 @@ /* eslint-env mocha */

// Node.js 0.10 and 0.12 support
Object.assign = process.versions.modules >= 46
? Object.assign // eslint-disable-next-line
: util._extend
describe('SPDY Server', function () {
fixtures.everyConfig(function (protocol, npn, version, plain) {
fixtures.everyConfig(function (protocol, alpn, version, plain) {
var server

@@ -36,3 +31,3 @@ var client

port: fixtures.port,
NPNProtocols: [ npn ]
ALPNProtocols: [ alpn ]
}, function () {

@@ -64,5 +59,9 @@ client = transport.connection.create(socket, {

stream.on('error', (err) => {
done(err)
})
stream.on('response', function (status, headers) {
assert.equal(status, 200)
assert.equal(headers.ok, 'yes')
assert.strictEqual(status, 200)
assert.strictEqual(headers.ok, 'yes')

@@ -76,4 +75,4 @@ fixtures.expectData(stream, 'response', done)

server.on('request', function (req, res) {
assert.equal(req.isSpdy, res.isSpdy)
assert.equal(req.spdyVersion, res.spdyVersion)
assert.strictEqual(req.isSpdy, res.isSpdy)
assert.strictEqual(req.spdyVersion, res.spdyVersion)
assert(req.isSpdy)

@@ -89,3 +88,3 @@ if (!plain) {

} else {
assert.equal(req.spdyVersion, version)
assert.strictEqual(req.spdyVersion, version)
}

@@ -95,5 +94,5 @@ assert(req.spdyStream)

assert.equal(req.method, 'GET')
assert.equal(req.url, '/get')
assert.deepEqual(req.headers, { a: 'b', host: 'localhost' })
assert.strictEqual(req.method, 'GET')
assert.strictEqual(req.url, '/get')
assert.deepStrictEqual(req.headers, { a: 'b', host: 'localhost' })

@@ -119,4 +118,4 @@ req.on('end', function () {

stream.on('response', function (status, headers) {
assert.equal(status, 200)
assert.equal(headers.ok, 'yes')
assert.strictEqual(status, 200)
assert.strictEqual(headers.ok, 'yes')

@@ -130,4 +129,4 @@ fixtures.expectData(stream, 'response', next)

server.on('request', function (req, res) {
assert.equal(req.method, 'POST')
assert.equal(req.url, '/post')
assert.strictEqual(req.method, 'POST')
assert.strictEqual(req.url, '/post')

@@ -161,3 +160,3 @@ res.writeHead(200, {

stream.on('response', function (status, headers) {
assert.equal(status, 100)
assert.strictEqual(status, 100)

@@ -189,3 +188,3 @@ fixtures.expectData(stream, 'response', done)

stream.on('response', function (status, headers) {
assert.equal(status, 100)
assert.strictEqual(status, 100)

@@ -215,4 +214,4 @@ fixtures.expectData(stream, 'response', done)

stream.on('pushPromise', function (push) {
assert.equal(push.path, '/push')
assert.equal(push.headers.yes, 'push')
assert.strictEqual(push.path, '/push')
assert.strictEqual(push.headers.yes, 'push')

@@ -227,4 +226,4 @@ fixtures.expectData(push, 'push', next)

server.on('request', function (req, res) {
assert.equal(req.method, 'POST')
assert.equal(req.url, '/page')
assert.strictEqual(req.method, 'POST')
assert.strictEqual(req.url, '/page')

@@ -266,4 +265,4 @@ res.writeHead(200, {

stream.on('response', function (status, headers) {
assert.equal(status, 200)
assert.equal(headers.ok, 'yes')
assert.strictEqual(status, 200)
assert.strictEqual(headers.ok, 'yes')

@@ -278,3 +277,3 @@ fixtures.expectData(stream, 'response', done)

gotHeaders = true
assert.equal(headers.trai, 'ler')
assert.strictEqual(headers.trai, 'ler')
})

@@ -302,3 +301,3 @@

stream.on('response', function (status, headers) {
assert.equal(status, 300)
assert.strictEqual(status, 300)

@@ -361,3 +360,3 @@ fixtures.expectData(stream, 'response', done)

assert.doesNotThrow(function () {
assert.equal(res.push('/push', {}), undefined)
assert.strictEqual(res.push('/push', {}), undefined)
res.end('response')

@@ -378,3 +377,3 @@ })

stream.on('response', function (status, headers) {
assert.equal(status, 200)
assert.strictEqual(status, 200)

@@ -413,3 +412,3 @@ fixtures.expectData(stream, 'hello world, what\'s up?', done)

server.on('request', function (req, res) {
assert.equal(req.headers['x-forwarded-for'], '1.2.3.4')
assert.strictEqual(req.headers['x-forwarded-for'], '1.2.3.4')
req.resume()

@@ -442,6 +441,6 @@ res.end()

var server = spdy.createServer(fixtures.keys, function (req, res) {
assert.equal(req.isSpdy, res.isSpdy)
assert.equal(req.spdyVersion, res.spdyVersion)
assert.strictEqual(req.isSpdy, res.isSpdy)
assert.strictEqual(req.spdyVersion, res.spdyVersion)
assert(!req.isSpdy)
assert.equal(req.spdyVersion, 1)
assert.strictEqual(req.spdyVersion, 1)

@@ -461,3 +460,3 @@ res.writeHead(200)

}, function (res) {
assert.equal(res.statusCode, 200)
assert.strictEqual(res.statusCode, 200)
res.resume()

@@ -480,6 +479,6 @@ res.on('end', function () {

var server = spdy.createServer(Pseuver, fixtures.keys, function (req, res) {
assert.equal(req.isSpdy, res.isSpdy)
assert.equal(req.spdyVersion, res.spdyVersion)
assert.strictEqual(req.isSpdy, res.isSpdy)
assert.strictEqual(req.spdyVersion, res.spdyVersion)
assert(!req.isSpdy)
assert.equal(req.spdyVersion, 1)
assert.strictEqual(req.spdyVersion, 1)

@@ -499,3 +498,3 @@ res.writeHead(200)

}, function (res) {
assert.equal(res.statusCode, 200)
assert.strictEqual(res.statusCode, 200)
res.resume()

@@ -502,0 +501,0 @@ res.on('end', function () {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc