Hacker News new | ask | show | jobs
by kixelated 213 days ago
I like to frame WebTransport as multiple WebSocket connections to the same host, but using a shared handshake.

It's common to multiplex a WebSocket connection but you don't need that with WebTransport, while also avoiding head-of-line-blocking.

But yeah I wish WebTransport had a better TCP fallback. I still use WebSocket for that.

1 comments

The thing is, I very rarely (or arguably never) have a use case which requires that one client has multiple connections to the same server. The thing I want is almost always to have a bidirectional stream of messages where messages arrive in order. Essentially a simple message envelope protocol on top of TCP.
For sure, if you want an ordered/reliable stream then WebSocket is ideal. WebTransport is useful when you also want prioritization and semi-reliable networking, similar in concept to WebRTC data channels.