haxe-ws 1.0.3

WebSockets everywhere! Including javascript, flash and sys targets.

Released 2017-04-20.

To install, run:

haxelib install haxe-ws 1.0.3

See using Haxelib in Haxelib documentation for more information.

This is not the latest stable version of haxe-ws. See version 1.0.5 for the latest version.

Maintainersoywiz
Websitehttps://github.com/soywiz/haxe-ws
Current version1.0.5
StatisticsInstalled 11221 times
LicensePublic
Tags

README.md

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
    }
}