Skip to content

Simple client-library for working with Web Sockets protocol

Notifications You must be signed in to change notification settings

rudevich/socked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Socked.js

Simple client-library for working with Web Sockets protocol

Using:

var router = {
      "message1": function(data) {
        console.log(data)
      }
    },
    socked = new Socked(function(err){
        if (err) {
            return false;
        }
        //send auth message
        that.socked.send('authorize',{"hi":"bro"});
    }, "responsibleWSURLfromRootOfYourServer", this.router);

Server must send messages in format:

{
  "data": {
    "seqID":1, // ID of message (ordered)
    "messageType": "wow", // type of message
    "data": 42 // any data you want
  }
}

About

Simple client-library for working with Web Sockets protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published