Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
Debugging http3 setup

I'm trying to setup an testing environment for http3 just for learning.

What I did so far:

  • Created a real let's encrypt certificate with dns-01
  • Compiled node.js with the experimental CUIC flag
  • Compiled curl with http3 support

I created a script with the content of the example:

'use strict';

const key = getTLSKeySomehow();
const cert = getTLSCertSomehow();

const { createQuicSocket } = require('net');

// Create the QUIC UDP IPv4 socket bound to local IP port 1234
const socket = createQuicSocket({ endpoint: { port: 1234 } });

socket.on('session', async (session) => {
  // A new server side session has been created!

  // The peer opened a new stream!
  session.on('stream', (stream) => {
    // Let's say hello
    stream.end('Hello World');

    // Let's see what the peer has to say...
    stream.setEncoding('utf8');
    stream.on('data', console.log);
    stream.on('end', () => console.log('stream ended'));
  });

  const uni = await session.openStream({ halfOpen: true });
  uni.write('hi ');
  uni.end('from the server!');
});

// Tell the socket to operate as a server using the given
// key and certificate to secure new connections, using
// the fictional 'hello' application protocol.
(async function() {
  await socket.listen({ key, cert, alpn: 'h3-25' });
  console.log('The socket is listening for sessions!');
})();

Just for future readers the functions getTLSKeySomehow() and getTLSCertSomehow() can be replaced by this:

const fs = require("fs")
const key = fs.readFileSync('privkey.pem')
const cert = fs.readFileSync('cert.pem')

Then I tried to open the webpage by enableding http3 in Firefox with the feature-flag network.http.http3.enabled enabled in about:config. With the address https://my.dev.domain.name:1234/ but this didn't work.

Using curl didn't work ether, might be worth noting that I'm using WSL on Windows 10. Accessing the same url on curl times out everytime. Just to check that my setup is fine: I can verify that Firefox and curl can access www.google.com flawless via http3.

When I implement a second http2 endpoint with the same key this works fine without any certificate warnings.

How can I debug what I'm doing wrong?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your code sample just implements QUIC - which is the transport protocol underneath HTTP/3 (similar to how TCP + TLS are the transport protocols below HTTP/1.1).

This means you need additional code for implementing HTTP/3 on top of Quic. Ideally you want a library, since it's rather complex. Here are links to the most recent draft version of the specifications which need to be implemented:

  • HTTP/3: https://datatracker.ietf.org/doc/html/draft-ietf-quic-http-33
  • QPACK: https://datatracker.ietf.org/doc/html/draft-ietf-quic-qpack-20

I assume node.js would eventually also add support for those, so that this task gets easier.

Without HTTP/3 support, you could test pure QUIC streams (without HTTP semantics) against your test server. You can use any of the various QUIC libraries to do this, but there might not be an out of the box CLI tool like curl.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda