Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!