Socket

A working example of using the socket object:

var conn = new Socket;  
var host =  "www.indesignjs.de";  
var cmd = "GET /index.html HTTP/1.1\r\nHost:"+host+"\r\n\r\n";  
var reply='';  
conn.timeout = 100;  
if (conn.open (host +':80', 'BINARY')) {  
		conn.write (cmd);  
		while (conn.connected && ! conn.eof) {  
		   reply += conn.read(1024) + "\n";  
		}  
		conn.close();  
		alert(reply);  
} 


Socket POST connection close


See also the Web page.