Fork of Aman Gupta's jsSocket with a rewritten javascript library and simplified flash / haxe socket implementation. As such, lib/JSSocket.hx is (c) Aman Gupta (tmm1) 2008.
It's like WebSockets but simpler. Use it as you would basic async sockets available in most different programming languages.
- Flash 9 or higher on the client side (widely available)
- Super simple async api
- You must escape html / binary data
JSSocket.connect("host", port, function(socket) {
socket.onOpen(function() {
socket.send("Hello there!");
console.log("Connected!");
});
socket.onData(function(data) {
console.log("Got Data:", data);
});
socket.onClose(function(reason) {
console.log("Lost connection, reason:", reason);
});
});
Licensed under the Ruby License