News for hackers. Stuff that matters.
Re:The future of web software is HTML over WebSockets by conradfr on Thursday February 25, 2021 @04:56PM (#26268843)
You restore the state like you would on a SPA or regular server side rendered page.

A crash or someone hitting refresh on his browser is not that different in this respect.

Re:The future of web software is HTML over WebSockets by m00x on Thursday February 25, 2021 @09:15PM (#26270764)
I'm astonished that people are asking these questions while there's obvious answers like this.

WSs aren't a magic wand, they just allow you to do more with the same.

Re:The future of web software is HTML over WebSockets by Kranar on Thursday February 25, 2021 @09:57PM (#26270953)
I don't see what's astonishing about it and I'm scratching my head asking the same question. If the answer is that you handle disconnections and reconnections the same way that the HTTP protocol does it, then what's the purpose of HTML over web sockets?

You basically end up with a half-assed, buggy, and potentially insecure reimplementation of HTTP running over web sockets running over HTTP at that point.

Are you going to do session management and identification by issuing a unique identifier as well? Is that unique identifier going to be valid in perpetuity or have a an expiry date? Is it going to be valid and secure across all sub-domains or will it be prone to cross site scripting attacks?

Re:The future of web software is HTML over WebSockets by coldtea on Friday February 26, 2021 @01:13AM (#26271811)
>I don't see what's astonishing about it and I'm scratching my head asking the same question. If the answer is that you handle disconnections and reconnections the same way that the HTTP protocol does it, then what's the purpose of HTML over web sockets?

The purpose is in the things explained well in TFA: single source of truth, no replicated state, simpler development, and so on...

Who said the purpose would/had to be in handing "the server caught fire" scenarios?

Re:The future of web software is HTML over WebSockets by conradfr on Friday February 26, 2021 @04:27AM (#26272919)
The purpose is to render your page the "old way" but having the dom updated like an SPA.

It works for certain things and not for others. So, it's not "the future of web software" like the title says, it's one additional possibility for when it makes sense.

Re:The future of web software is HTML over WebSockets by ricketycricket on Thursday February 25, 2021 @11:14PM (#26271295)
> then what's the purpose of HTML over web sockets?

Because you can do things stateless HTML alone cannot do.

No one is trying to re-implement HTTP, or even remove it from the equation.

What people are trying to reimplement (or rather, replace) is the HTML + JSON:API + React + Redux mess. Websockets is a means to that end.

Re:The future of web software is HTML over WebSockets by wokwokwok on Thursday February 25, 2021 @11:22PM (#26271340)
Hm... great intentions, but you don’t seem to have actually answered any of the questions from the parent comment.

Unfortunately, great intentions alone won’t make this work; someone has to actually answer the hard questions about how it’s going to work too.

All the answers I’ve seen so far trying to answer them have been vague hand waving...

That doesn’t leave me with much confidence.

Re:The future of web software is HTML over WebSockets by coldtea on Friday February 26, 2021 @01:14AM (#26271818)
>Unfortunately, great intentions alone won’t make this work; someone has to actually answer the hard questions about how it’s going to work too.

People did better than that, they already built applications with this model.

Re:The future of web software is HTML over WebSockets by ricketycricket on Thursday February 25, 2021 @11:35PM (#26271397)
You are welcome to actually look at the code for any of these solutions.

Here is the documentation for Phoenix channel authentication (what Phoenix Live View is built upon): https://hexdocs.pm/phoenix/channels.html#using-token-authent...

Additionally, here is some documentation on the security considerations specific to Live View: https://hexdocs.pm/phoenix_live_view/security-model.html

Searching can probably find you more information.