From 1bd1b56ce3f350fe117a78eab520198f26b2842b Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Mon, 23 May 2016 11:11:02 -0700 Subject: [PATCH] Revert "add http2 support back" This reverts commit b1a979d698d3184b0ed5bb494a6a5ac838c3450d. --- lib/agent.js | 11 +++++------ package.json | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/agent.js b/lib/agent.js index bbb8c07..84debbc 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -1,6 +1,4 @@ -import http2 from 'spdy'; import fetch from 'node-fetch'; -import { parse } from 'url'; /** * Returns a `fetch` version with a similar @@ -16,16 +14,17 @@ import { parse } from 'url'; export default class Agent { constructor (url, { debug } = {}) { this._url = url; - this._host = parse(url).host; this._debug = debug; this._initAgent(); } _initAgent () { - this._agent = http2.createAgent({ + /* + this._agent = https.createAgent({ host: this._host, port: 443 }).once('error', (err) => this._onError(err)); + */ } _onError (err) { @@ -44,7 +43,7 @@ export default class Agent { } const { body } = opts; - opts.agent = this._agent; + // opts.agent = this._agent; if (body && 'object' === typeof body && 'function' !== typeof body.pipe) { opts.headers['Content-Type'] = 'application/json'; @@ -60,6 +59,6 @@ export default class Agent { close () { if (this._debug) console.log('> [debug] closing agent'); - return this._agent.close(); + // return this._agent.close(); } } diff --git a/package.json b/package.json index 8aa636b..1139446 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "socket.io-client": "1.4.5", "split-array": "1.0.1", "text-table": "0.2.0", - "spdy": "3.3.3", "email-validator": "1.0.4", "email-prompt": "0.1.4" },