To enable Web applications to communicate using TCP this specification introduces the TCPSocket interface and a corresponding optional security model.
var con = null;
try { 
con = new TCPSocket(", "12345");
catch (ex) { 
if ("SECURITY_ERR" == ex.message) { 
alert("unable to connect") 

con.addEventListener("socketdata", function(ev) {
if ("pong" == { alert("Success"); }
else { alert("Failure"); }

The TCPSocket interface enables a TCP connection from the client to the server from which the script was downloaded and executed from. Instances of this object can be made using a constructor on the Window object. W3C

Cool stuff!