frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

HTML over WebSockets: real-time SPAs with barely any JavaScript

https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/
18•redbell•1h ago

Comments

thiagovsdiniz•47m ago
great one
ChiperSoft•43m ago
Is this satire? Rage bait? Why would you ever do this?

Just make a normal website!! You've invented an MPA with extra steps!

x0x0•33m ago
Responsive site built via server-side render, with a particular benefit for partial page updates. 90% of the benefit of an SPA but 10% of the code: no api, no moving of system of record for state back and forth between database and browser (it's always db), etc. And you can avoid react.

A common use case: eg in Rails, a user has a table open. you can stream new records to the top of that table as they are created in ~5 lines of ruby (a broadcast on the model, and put the table rows in a turbo_frame with a turbo_stream_from somewhere on the page).

There are real limits to this -- you have to hold the update dependency graph in your head -- but the benefits are huge for small to medium amounts of responsiveness.

My experience has been great with Rails/Turbo and htmx.

hackingonempty•38m ago
> The quick rule: if you need bidirectional, low-latency communication (chat, collaboration, games), WebSocket; if you only push from the server, SSE is simpler and cheaper to operate.

For most apps just use SSE and the built-in code for making HTTP requests (Fetch) instead of hacking up your own client side JS to make requests over a WebSocket. The latency is the same because modern browsers multiplex HTTP requests over a single TCP connection that is left open.

Maybe if you are making many client requests per second there is an advantage to not sending full headers/cookies/etc... on each request but not if you're sending requests in response to user clicks/touches.

Any sufficiently complicated SPA contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Fetch.

clappski•8m ago
> The latency is the same because modern browsers multiplex HTTP requests over a single TCP connection that is left open.

In my experience this isn’t true; firstly you’re relying on an implementation detail of the platform that you’re executing on, of which you have no control over on the client side. Secondly, even if you aren’t opening a new connection per request, you’re still travelling through an entire HTTP stack implementation rather than the incredibly simple WebSocket protocol - effectively a length and a mask to get the contents, rather than some (in http1 land) fuzzy parser.

If you can guarantee you’re hitting http2 or http3 then you might be closer in latency, but due to the complexity of both I would imagine plain http1 negotiated persistent WebSockets provide the best latency.

doublerabbit•37m ago
> Simple, elegant and fast.

Until someone bombs your websocket server and you then have nothing at all.

hyperhello•32m ago
What’s wrong with this idea, really? It’s redundant because you can serve HTML to requests with Apache or Ngnix or any other server on the happy path.

What’s right with the idea, really? It’s exactly what the tried and true preferences of developers have been shown to be: getting in the way of the happy path for no reason.

Now you can have build steps and put story points in Jira and do it all on the server where we don’t have to see it, and the success condition is that the text gets served. Both sides can be happy now.

doublerabbit•15m ago
> What’s wrong with this idea, really? It’s redundant because you can serve HTML to requests with Apache or Ngnix or any other server on the happy path.

Overhead, security, denial of service.

You now have two states to track. Is the web-server up to date with the version the web socket is hosting?

Is monitoring correct? Is your web server going to be alive if the web socket server is offline?

If they're going to follow both the same source of truth why not just use the web-server? Which is more tried and true, easier to cluster and much more reliable than JavaScript and you can actually serve a website without requiring JavaScript.

If corporate firewalls are blocking web sockets you are going to be rendering blank to the client because there isn't any easy way to determine if the client is blocked. How do you detect this? How do you remedy this?

You still need something to serve the JavaScript fronted of the website. Unless you create a WebSocket HTTP server which you've then opened a can of worms you have a web-server sitting idle wasting resources.

I bombard your web socket server with faux requests and take it offline. Not your web-server and now you're rendering nothing. Yet the web server is straining to serve content, how do you determine if the web socket is dead? More complexity.

It's not wrong, but a waste of time and resources and the overhead of it all just isn't worth it because you have to make alterations and tests for n+1.

nchmy•25m ago
A good response to this post

https://yagni.club/3mstlyuxe5s26

pseudosavant•8m ago
Definitely a well reasoned counter point to choosing websockets over SSE.
nchmy•36s ago
I forgot to link to OP's response to the response. It's mostly Ai slop.

https://en.andros.dev/blog/bd74e61a/were-fighting-over-the-w...

pjmlp•9m ago
Love how DHTML, ASP.NET Ajax, JSF Ajax kind of keeps being re-invented.
frollogaston•5m ago
So a RESTless webserver

DeepSeek V4 Pro 0813

https://openrouter.ai/deepseek/deepseek-v4-pro-0813
271•explosion-s•1h ago•82 comments

Tailscale Traces Database Corruption to 16y/o SQLite WAL-Reset Bug

https://tailscale.com/blog/sqlite-wal-reset-bug
422•ropbear•3h ago•64 comments

2026 Eclipse Webcams

https://jonty.github.io/2026_eclipse_webcams/
381•zoenolan•6h ago•95 comments

Glaciers on the Climate Dashboard

https://climate.metoffice.cloud/glaciers.html
41•mooreds•1h ago•3 comments

Tim King, AmigaDOS developer, has died

https://amiga-news.de/en/news/AN-2026-08-00070-EN.html
121•doener•3h ago•22 comments

Someone is running mass vulnerability scans, spoofing AI bots like ClaudeBot

https://knownagents.com/insights
126•gavinhking•3h ago•76 comments

Why Tiny JPEGs Look Different in Chrome

https://guillaumetech.github.io/posts/jpg-scaling-chrome/
156•gutechh•3h ago•28 comments

Reflex (YC W23) Is hiring Growth and GTM Roles

https://www.ycombinator.com/companies/reflex/jobs/71x5GFb-growth-engineer
1•apetuskey•58m ago

Wednesday, August 12: GitHub, Incident with Pull Requests and Issues

https://www.githubstatus.com/incidents/76t89hbfb09h
34•arm32•1h ago•4 comments

SpaceXAI's Grok 4.6 Scores 61 on the Artificial Analysis Intelligence Index

https://artificialanalysis.ai/articles/grok-4-6-benchmarks-and-analysis
82•wertyk•1h ago•32 comments

HTML over WebSockets: real-time SPAs with barely any JavaScript

https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/
18•redbell•1h ago•13 comments

License plate reader searches should require a warrant

https://andrewpwheeler.com/2026/08/12/license-plate-reader-searches-should-require-a-warrant/
347•apwheele•3h ago•214 comments

AI is removing the middle class of software engineering

https://blog.florianherrengt.com/ai-removing-middle-class-software-engineering.html
426•florianherrengt•4h ago•357 comments

Bike Bureau: Report Bike Lane Obstructions

https://loudbicycle.com/bb
25•kdmccormick•1h ago•14 comments

Qwen/Qwen3.8-2.4T-A95B

https://huggingface.co/Qwen/Qwen3.8-2.4T-A95B
200•Philpax•2h ago•60 comments

Pixel Watch 5

https://blog.google/products-and-platforms/devices/pixel/pixel-watch-5/
18•ortusdux•1h ago•9 comments

We just raised $400M in Series C

https://lovable.dev/blog/series-c
28•thoughtpeddler•1h ago•8 comments

What sort of maths are LLMs good at?

https://gowers.wordpress.com/2026/08/12/what-sort-of-maths-are-llms-good-at/
199•ColinWright•7h ago•96 comments

The Bit Player: My Father with Steve Zissou

https://www.theparisreview.org/blog/2026/07/27/the-bit-player-my-father-with-steve-zissou/
11•Thevet•4d ago•0 comments

Shade Map

https://shademap.app
68•fredley•4h ago•19 comments

Show HN: Woxi - Open-source Mathematica / Wolfram Language reimplementation

https://woxi.ad-si.com
211•adius•7h ago•30 comments

Hax – a minimalist, terminal-native coding agent written in C

https://usehax.dev/
39•OleksandrC•3h ago•11 comments

Qwen3.8-2.4T

https://huggingface.co/Qwen/Qwen3.8-2.4T-A95B-FP8
16•mmastrac•1h ago•0 comments

Delphi 13 Community Edition Is Now Available

https://blogs.embarcadero.com/delphi-13-community-edition-is-now-available/
122•layer8•6h ago•85 comments

Felix and I

https://jacobfilipp.com/felix/
48•surprisetalk•2d ago•3 comments

Automatic1111 for Apple metal, 40% speed up sd1.5

https://therad.ninja/from-8-10-seconds-to-3-7-teaching-automatic1111-to-speak-metal-on-an-m3-pro/
46•dmikey831•4h ago•18 comments

Solving the Shortest Vector Problem in $2^{0.6039n}$ Time via Mid-Point Hessian

https://arxiv.org/abs/2608.02478
25•sbulaev•1w ago•6 comments

High-Res Photo Shows Sand-Capped Butte Rising from Mars Plain of Polygons

https://petapixel.com/2026/08/04/amazing-high-res-photo-shows-a-butte-rising-from-mars/
127•bookofjoe•6d ago•10 comments

My Agent Setup

https://chad.cm/posts/2026-8-11-my-agent-setup
72•carimura•4h ago•39 comments

Bigos (Polish Hunter's Stew) Recipe Builder

https://chefsbinge.com/bigos-recipe-builder/
62•doublepg23•5d ago•21 comments