News for hackers. Stuff that matters.
Re:HTTP/3: from root to tip by crgwbr on Sunday January 27, 2019 @05:40PM (#19014206)
Honestly curious: how would you use HTTP{2,3} to push a real-time message from server to client without a WebSocket? Are we back to just long polling?
Re:HTTP/3: from root to tip by seabrookmx on Sunday January 27, 2019 @06:52PM (#19014507)
Exactly. I think most people didn't use Websockets due to the theoretical performance improvement over HTTP 1.1, but because it's a different programming model.

I think it's very shortsighted to assume people should (or want) to roll their own streaming protocol when Websocket is already a great fit for many applications.

Re:HTTP/3: from root to tip by jungturk on Sunday January 27, 2019 @05:55PM (#19014267)
Re:HTTP/3: from root to tip by Matthias247 on Sunday January 27, 2019 @05:46PM (#19014233)
You can use server-sent-events or use do some custom streaming format inside the response body. The latter might not work well, due to the fact that arbitrary streaming APIs might not yet be exposed by all browsers (ReadableStream on fetch API: https://caniuse.com/#feat=streams).
Re:HTTP/3: from root to tip by cryptonector on Sunday January 27, 2019 @06:10PM (#19014344)
I thought all XHRs support streaming, and they should run over HTTP/{2,3}. Is that not right?
Re:HTTP/3: from root to tip by Matthias247 on Sunday January 27, 2019 @08:58PM (#19014948)
Afaik XHR allows you to access received data in a streaming fashion, but the XHR type will always buffer the full received payload internally. So if you try to stream a large amount of data over it you will eventually run out of memory. If you want to consume a potentially endless stream with custom encoding you need the fetch API with streaming support for that (https://developer.mozilla.org/en-US/docs/Web/API/Streams_API...), as far as I understood. Or websockets.

That is one reason that e.g. gRPC streaming support doesn't work trivially in browsers.

Re:HTTP/3: from root to tip by jrockway on Sunday January 27, 2019 @06:47PM (#19014483)
gRPC is already HTTP/2.0 and has bidirectional streams. I imagine it would work like that.

Browsers are almost at the point where they can just talk gRPC to the backend, but gRPC uses HTTP trailers which browsers do not support.

I don't think, from a networking standpoint, that websockets was really necessary. A browser and a web server already have a socket open that they send messages in either direction on. It's just so much of the web was designed around "client asks for something, server sends the result and closes the connection" that some transition period was necessary to distinguish between the two cases. (You didn't necessarily provision your web server for maintaining hundreds of thousands of open connections.) But now that people are used to the idea of connections sticking around in the context of HTTP, it's no big deal to send arbitrary data over that connection.

Re:HTTP/3: from root to tip by icebraining on Sunday January 27, 2019 @07:11PM (#19014588)
But can the client in HTTP/2 send more data to the server after it has received something, without having to send a full HTTP request? If not, I don't see how something like agar.io, which requires constant updates to the server on every mouse movement, can work without tremendous header overhead.
Re:HTTP/3: from root to tip by gizzlon on Monday January 28, 2019 @07:47AM (#19017019)
Not really, it's rpc and websocket is not. I looked into this for a project and neither http/2 or gRPC does the same thing : fully bidirectional, long-lived stream with no weird semantics or hacks.