This is what Plex does: https://blog.filippo.io/how-plex-is-doing-https-for-all-its-...
Do you actually need a root cert for this? Can't you just install the server's self-signed cert?
I think it's actually self-signed certificate for domain (localbattle.net) which resolves to 127.0.0.1, not CA one, sorry for misinformation.
That's much less troubling. It's much harder to engage in shenanigans in that case.
What's the point of using tls on localhost?
Browsers require it. If you're establishing connection from JavaScript that was loaded on HTTPS website, you can't establish connection to HTTP.
I've heard recently about some movement to allow HTTP connections to localhost, but I did not investigate that thoroughly. TLS should not be needed for localhost, that's true.
I don't like this practice too and I would opt-out of that "feature" having the choice. I just used to develop similar software, so I understand why they did that.