django / asgiref

ASGI specification and utilities
https://asgi.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.46k stars 207 forks source link

Spec for WebTransport in ASGI #280

Open jlaine opened 3 years ago

jlaine commented 3 years ago

With QUIC standardisation complete (RFC 9000) and HTTP/3 nearing completion, a new spec is shaping up: WebTransport:

https://w3c.github.io/webtransport/ https://datatracker.ietf.org/doc/html/draft-vvv-webtransport-http3

This specification revolves around a "session" initiated by the client over an HTTP3 connection by means of a CONNECT method to a give path/authority. The session then provides:

I am currently working on integrating WebTransport support in aioquic, my QUIC/HTTP3 stack, so hypercorn could very soon have support for WebTransport (hi @pgjones).

See: https://github.com/aiortc/aioquic/pull/204

It would be great if there was a standardised API for Python web apps to leverage this, so I'd love us to start the discussion!

andrewgodwin commented 3 years ago

Gosh, that's a lot of spec to cover. I think a good first move here would be to implement a prototype server and play with the message format a bit until it starts to feel alright to write apps against? That's what I did with HTTP and WebSocket.

jlaine commented 3 years ago

Sounds good, I'll do exactly that. The aioquic repository already features a basic HTTP/3 server which can run ASGI apps, I'll tack on a WebTransport demo.

jlaine commented 3 years ago

Maybe @bashi has some insights here in light of the specification work done for the Web Platform Tests?

bashi commented 3 years ago

Unfortunately I haven't explored integration with wsgi/asgi when I prototyped a WebTransport over HTTP/3 server for WPT. This is mostly because wptserve has a design goal which gives test authors control of the exact bytes sent over the wire and their timing (See: introduction).

Current proposed WPT APIs for WebTransport over HTTP/3 can be found here. I plan to update the proposed APIs once @jlaine's work has done.

jlaine commented 3 years ago

I have started putting together a demo WebTransport server with an "extended" ASGI implementation. So far the new messages I have are:

Server => ASGI app

ASGI app => server

guest271314 commented 3 years ago

when I prototyped a WebTransport over HTTP/3 server for WPT

Is the server code published on GitHub?

jlaine commented 3 years ago

Is the server code published on GitHub?

Yes, the http3_server.py provided with aioquic includes the WebTransport demo, and I've provided some instructions on how to use it in https://github.com/aiortc/aioquic/issues/163