How to use Express server with `http2.createSecureServer` for HTTP/2? · Issue #6863 · expressjs/express · GitHub
Skip to content

How to use Express server with http2.createSecureServer for HTTP/2? #6863

Open

Description

@khteh

Description

I previously used spdy for HTTP/2. However, due to spdy-http2/node-spdy#403 and the repo is inactive, I would like to consider using node native HTTP/2 but there are some caveats. The express app uses a lot of interfaces which work with other third-party libraries like app.use, app.set, app.enable in order to use view engines, setting the views and static artifacts folder, etc. How to achieve this using the http2.createSecureServer? I don't see that in https://nodejs.org/api/http2.html

Minimal Reproduction

import fs from 'fs';
import { app } from './index.js';
import http2 from 'http2';

const options = {
  key: fs.readFileSync('server.key'),
  cert: fs.readFileSync('server.crt')
};

app.set('port', port);
const server = http2.createSecureServer(options, app);

Activity

  1. krzysdz commented on Oct 28, 2025

    @krzysdz
    Contributor

    Express doesn't support HTTP/2 yet. There's a bit more information in expressjs/discussions#407 and #5462.

  2. BhavishTrehan77 commented on Oct 5, 2026

    @BhavishTrehan77

    Hi @krzysdz, I’d like to work on this issue. I’m interested in understanding the current Express server architecture and exploring how http2.createSecureServer() could be used with Express.

    Would it be possible to assign this issue to me? I’ll first investigate the current limitations and the related discussions before proposing an implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions