Recently I was able to get the Newspeak IDE running as an Isolated Web App. As such, it has access to Chrome's implementation of Direct Sockets: TCPSockets, UDPSockets, their server socket counterparts, even multi-casting (whatever that is).
This feature is a WICG proposal and only implemented in chromium. The thing about IWA's is they are not available from the "drive by" web. They must be distributed as a signed web bundle. Under development you can use the serve-newspeak server setup to run the IDE, but once bundled and installed, there is no need to start a local web server. It's exists as an icon on the desktop just like a PWA, but it runs completely locally.
I have also attached a bundle of the IDE that you can download and install and "should work". Then you too can have endless hours of programming joy with TCP Sockets. Otherwise I would need to duplicate the setup and share it via github which needs more work. The bundling part presents some special roadblocks that currently have me stumped :)
To use the attached bundle, you would follow the same steps but choose "Install IWA from Signed Web Bundle".
This video shows a Proof of Concept app that connects to a MUMPS database. The TCP protocol is implemented in a javascript library so not much socket programming required: https://youtu.be/-O7GAICtOOA This application is special in that it is deployed to javascript before bundling.
Cheers
--