Skip to content

Commit b92e5fd

Browse files
yi-geevilebottnawi
authored andcommitted
fix: SPDY fails in node >= 11.1.0 (#1660)
1 parent f78a9a3 commit b92e5fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Server.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const tls = require('tls');
1717
const url = require('url');
1818
const http = require('http');
1919
const https = require('https');
20-
const spdy = require('spdy');
2120
const sockjs = require('sockjs');
2221

2322
const semver = require('semver');
@@ -635,7 +634,12 @@ class Server {
635634
if (semver.gte(process.version, '10.0.0')) {
636635
this.listeningApp = https.createServer(options.https, app);
637636
} else {
638-
this.listeningApp = spdy.createServer(options.https, app);
637+
/* eslint-disable global-require */
638+
// The relevant issues are:
639+
// https://github.com/spdy-http2/node-spdy/issues/350
640+
// https://github.com/webpack/webpack-dev-server/issues/1592
641+
this.listeningApp = require('spdy').createServer(options.https, app);
642+
/* eslint-enable global-require */
639643
}
640644
} else {
641645
this.listeningApp = http.createServer(app);

0 commit comments

Comments
 (0)