Add a Javascript API to enable a web app to open a TCP socket (as opposed to WebSocket) with the origin server.
Add a Javascript API to enable a web app to open a TCP socket (as opposed to WebSocket) with the origin server.
This is a seriously scary concept. It has all the same dangers as the automatic-file-opening did in Outlook.
It can probably be done securely, but wow, that's not an easy problem.
The handshake and HTTP upgrade are there for a reason. Connecting out from web applications with straight TCP breaks the web security model. After the handshake, you can treat WebSocket binary frames as if they were a TCP byte stream. Speak any protocol you want to.
Anything you can do with TCP you can do with WebSocket. The only exception is that you cannot connect to a listening server that does not expect the WebSocket handshake. That is intentional! In fact, that is the reason for the WebSocket handshake.