Skip to content

Commit 25cbf84

Browse files
committed
Use http/2 :)
1 parent f9af408 commit 25cbf84

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/Server.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var express = require("express");
55
var compress = require("compression");
66
var sockjs = require("sockjs");
77
var http = require("http");
8-
var https = require("https");
8+
var spdy = require("spdy");
99
var httpProxyMiddleware = require("http-proxy-middleware");
1010
var serveIndex = require("serve-index");
1111
var historyApiFallback = require("connect-history-api-fallback");
@@ -307,7 +307,13 @@ function Server(compiler, options) {
307307
options.https.cert = options.https.cert || fs.readFileSync(path.join(__dirname, "../ssl/server.crt"));
308308
options.https.ca = options.https.ca || fs.readFileSync(path.join(__dirname, "../ssl/ca.pem"));
309309

310-
this.listeningApp = https.createServer(options.https, app);
310+
if(!options.https.spdy) {
311+
options.https.spdy = {
312+
protocols: ["h2", "http/1.1"]
313+
};
314+
}
315+
316+
this.listeningApp = spdy.createServer(options.https, app);
311317
} else {
312318
this.listeningApp = http.createServer(app);
313319
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
"http-proxy-middleware": "~0.17.1",
1414
"opn": "4.0.2",
1515
"serve-index": "^1.7.2",
16-
"sockjs": "0.3.17",
16+
"sockjs": "0.3.18",
1717
"sockjs-client": "1.1.1",
18+
"spdy": "^3.4.1",
1819
"strip-ansi": "^3.0.0",
1920
"supports-color": "^3.1.1",
2021
"webpack-dev-middleware": "^1.4.0",

0 commit comments

Comments
 (0)