Skip to content

Haxe WebSockets everywhere! Including javascript, flash and sys targets.

Notifications You must be signed in to change notification settings

romanmikhailov/haxe-ws

 
 

Repository files navigation

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

About

Haxe WebSockets everywhere! Including javascript, flash and sys targets.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haxe 99.8%
  • HTML 0.2%