Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 646 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 646 Bytes

MalWebSocket

My Websocket class made by 100% pure javascript.

##How to use

var net=require("net");
var MSocket=require("./MSocket");


var server=net.createServer(function(s)
{
    var socket=new MSocket(s,function()
    {
        socket.bindReader(function(msg)
        {
            console.log(msg.fin);
            console.log(msg.length);
            console.log(msg.opCode);
            console.log(msg.content.toString());
            socket.write("SDLFJSLDFJLSKDFJSLDKJF");
        });
        socket.ack();
        console.log(socket.subProtocol);
    });
});
server.listen(8080);
console.log("Server started!");