WebSockets everywhere! Including javascript, flash and sys targets.


Keywords
c#, cpp, java, js, neko, openssl, php, python, ssl, swf, websockets, ws, wss
License
QPL-1.0
Install
haxelib install haxe-ws 1.0.3

Documentation

Haxelib Version

WebSockets everywhere! Including javascript, flash and sys targets.

class WebSocketExample {
    static public function main() {
        trace('testing!');
        var ws = WebSocket.create("ws://127.0.0.1:8000/", ['echo-protocol'], false);
        ws.onopen = function() {
            trace('open!');
            ws.sendString('hello friend!');
        };
        ws.onmessageString = function(message) {
            trace('message from server!' + message);
        };

        #if sys
        while (true) {
            ws.process();
            Sys.sleep(0.1);
        }
        #end
    }
}