3

I have been looking into QUIC recently and have looked through different implementations, e.g. aioquic and QUIC for Node.js.

All the examples, which are given for these implementations seem to be aimed at server-to-server communication, or at least I couldn't find any example, which uses script, that could be used in a browser.

Are there any examples on how to create and open a QUIC connection from Javascript on the web browser (e.g. Chrome, since it is one of the few browsers, which "support" QUIC at the moment)?

What I want to try out in the end is file upload and download, but an example for a general request/response communication between the web browser and server using QUIC would already be a big help.

Best regards

EDIT: Related, but unanswered question: Open Quic (protocol) session via JS

Geshode
  • 2,498
  • 5
  • 15
  • 24
  • 1
    Isn't HTTP over QUIC the basis for HTTP/3 which is in Chrome, but not enabled by default? – jfriend00 Jul 20 '20 at 07:41
  • 1
    Yes, HTTP over QUIC is now HTTP/3, if I understood it correctly. But I haven't found an example of how to use QUIC or HTTP/3 through JS in the web browser. – Geshode Jul 20 '20 at 07:56
  • 1
    For the latest generation of QUIC, I think you will need a browser that supports HTTP/3 natively because Javascript in a browser does not have the ability to implement lower level protocols like HTTP over QUIC from pure Javascript. Apparently, recent builds of Chrome can do HTTP/3 with a command line flag. You can't even do UDP from browser Javascript. – jfriend00 Jul 20 '20 at 08:02
  • 3
    FYI, the browser decides whether to use http, http/2 or http/3 through some auto-negotiation. It's my understanding that it may even take a few connections to a site before it figures out it can use http/3. Worth reading this: https://blog.cloudflare.com/http3-the-past-present-and-future/. – jfriend00 Jul 20 '20 at 08:07
  • Thanks, I will take a look. I just thought, that it is also necessary to open the QUIC session in the web browser, since all the QUIC examples, which I have found so far used server and client to create a QUIC session. – Geshode Jul 20 '20 at 08:18
  • Well, if you're using the browser, there's no specific QUIC flag or QUIC library to use QUIC. You just use `fetch()` and if the target is known to support http/3, then the browser will use http/3 (which is based on QUIC). From nodejs, you could use QUIC yourself independent of http/3 to a known host that supports it, but that's only in nodejs where you have many more networking options. – jfriend00 Jul 20 '20 at 21:44

0 Answers0