Really impressed by the depth and breadth of this project, well done! A particularly interesting part is the socket layer inside the browser. Other people solving this problem have previously used a proxy to a server that does the real socket implementation. This means you can't have a "browser-only" solution. The author has solved this (for HTTP/S only) by proxying HTTP requests and then re-creating them as fetch re…
Still, very neat, agreed. Almost certainly the best you can do without having some kind of backend proxy running on either the server or the user's own machine.