Skip to content

Question: What is the status of HTTP/2 support? #1713

Closed
@Aghassi

Description

@Aghassi
  • Operating System: macOS 10.14.3
  • Node Version: 10
  • Yarn Version: 1.13.0
  • webpack Version: 4.29.4
  • webpack-dev-server Version: 3.2.1
  • This is a bug
  • This is a modification request
  • This is a question

I spent about an hour digging around yesterday and couldn't find the answer to this question, so I wanted to post here and get some insight.

I read through #516, which seems to indicate there is HTTP/2 supported, but I couldn't find any docs on how to enable it. All I found in the official docs was the line under this section https://webpack.js.org/configuration/dev-server/#devserverhttps saying that it can run with HTTP/2.

In the code in this repo I found this

if (!options.https.spdy) {
options.https.spdy = {
protocols: ['h2', 'http/1.1'],
};
}
// `spdy` is effectively unmaintained, and as a consequence of an
// implementation that extensively relies on Node’s non-public APIs, broken
// on Node 10 and above. In those cases, only https will be used for now.
// Once express supports Node's built-in HTTP/2 support, migrating over to
// that should be the best way to go.
// The relevant issues are:
// - https://github.com/nodejs/node/issues/21665
// - https://github.com/webpack/webpack-dev-server/issues/1449
// - https://github.com/expressjs/express/issues/3388
if (semver.gte(process.version, '10.0.0')) {
this.listeningApp = https.createServer(options.https, app);
} else {
/* 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);
}

All of which links to issues and other repos which have either been closed or have no work being done on them. And according to this comment #1493 (comment), it is planned for v4, but nothing in the 4.0.0 milestone https://github.com/webpack/webpack-dev-server/milestone/4 seems to support that statement.

Ultimately, I'm confused as to the current situation. Does Webpack-Dev-Server support HTTP/2? If not, will it be supported in the future?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions