Skip to content

gogoprog/hxsocketio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Haxe externs for socket.io

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published