News for hackers. Stuff that matters.
Re:Show HN: I made a browser-based RTS game by boredtofears on Saturday May 07, 2022 @09:46PM (#31300466)
There’s no way you could do anything real time with full HTTP request round trips for updates
Re:Show HN: I made a browser-based RTS game by jlokier on Sunday May 08, 2022 @06:09AM (#31302696)
The trick was to run many HTTP requests in parallel, using different subdomains so they wouldn't be subject to the browser limit on number of parallel connections to a domain, a dummy first request per subdomain so the interesting messages went over established persistent connections, and decoupling outbound from inbound messages to make a set of "short-long-polling" connections.

That resulted in real-time message throughput close to the game frame rate, bidirectional, and no connection setup latency per message, just the transmission latency even over TLS (SSL back then).