Skip to content

Commit

Permalink
create secure server when using http2 module
Browse files Browse the repository at this point in the history
  • Loading branch information
rvab committed Dec 20, 2023
1 parent d787281 commit 1986484
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/browser-sync/lib/server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ var serverUtils = {
return {
server: (function() {
var httpModule = serverUtils.getHttpModule(options);
const isUsingHttp2Module = options.get("httpModule") === "http2";

if (
options.get("scheme") === "https" ||
options.get("httpModule") === "http2"
) {
if (options.get("scheme") === "https" || isUsingHttp2Module) {
var opts = serverUtils.getHttpsOptions(options);
if (isUsingHttp2Module) {
// Create an HTTP/2 server with HTTPS
return httpModule.createSecureServer(opts.toJS(), app)
}
// Create a regular HTTPS server
return httpModule.createServer(opts.toJS(), app);
}

Expand Down

0 comments on commit 1986484

Please sign in to comment.