Skip to content

Commit

Permalink
fix: SPDY fails in node >= 11.1.0 (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-ge authored and evilebottnawi committed Feb 18, 2019
1 parent f78a9a3 commit b92e5fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const tls = require('tls');
const url = require('url');
const http = require('http');
const https = require('https');
const spdy = require('spdy');
const sockjs = require('sockjs');

const semver = require('semver');
Expand Down Expand Up @@ -635,7 +634,12 @@ class Server {
if (semver.gte(process.version, '10.0.0')) {
this.listeningApp = https.createServer(options.https, app);
} else {
this.listeningApp = spdy.createServer(options.https, app);
/* eslint-disable global-require */
// The relevant issues are:
// https://github.com/spdy-http2/node-spdy/issues/350
// https://github.com/webpack/webpack-dev-server/issues/1592
this.listeningApp = require('spdy').createServer(options.https, app);
/* eslint-enable global-require */
}
} else {
this.listeningApp = http.createServer(app);
Expand Down

0 comments on commit b92e5fd

Please sign in to comment.