localcoder.org is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, localcoder.org has it all. We hope you find what you are searching for!
are you writing a Chrome-Extension?
Based on your link it is only available in Chrome-Extensions and are experimental.
Chrome now has support for raw TCP and UDP sockets in its ‘experimental’ APIs. These features are only available for extensions and, although documented, are hidden for the moment.
solution 1: Chrome Extensions
solution 2: just a specification documentation. The API is not implemented in any browser yet
solution 3: uses WebSockets to initially talk from the browser. Some external server written in python makes a TCP socket.
solution 4: flash (dead)
solution 5: Chrome Extensions
WebSockets are all you can use for the moment. that is why for example MQTT in JavaScript also only supports WebSockets, not TCP.