hxsocketio

Externs for socket.io
https://github.com/gogoprog/hxsocketio/

To install, run:

haxelib install hxsocketio 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

hxsocketio

Haxe externs for socket.io.

Basic usage

Requirements

  • Only Haxe JavaScript target supported
  • Socket.io npm modules

Server

import js.node.socketio.*;

class ServerTest
{
    static public function main()
    {
        var server = new Server();

        server.listen(8000);

        server.on(
            'connection',
            function(socket:Socket)
            {
                socket.emit('message', { content: 'Hello World!' });

                socket.on('message',
                    function (data)
                    {
                        // Do something
                    });
            }
        );
    }
}

Client

Both browser and Node.js JavaScript are supported.

import js.node.socketio.*;

class ClientTest
{
    static public function main()
    {
        var client = new Client("http://localhost:8000/");

        client.on('message',
            function (data)
            {
                // Do something
            });
    }
}
Contributors
gogoprog
Version
0.1.0
Published
8 months ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github