Skip to content

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

Notifications You must be signed in to change notification settings

imcasper/haxe-ws

This branch is 1 commit ahead of, 4 commits behind soywiz-archive/haxe-ws:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3254b82 · Jun 10, 2017

History

67 Commits
Jun 10, 2017
Oct 13, 2016
Jan 3, 2017
Apr 20, 2017
Nov 2, 2016
Aug 31, 2016
Nov 2, 2016
May 15, 2017
Aug 31, 2016

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%