Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (22 sloc) 1005 Bytes


A port of the jquery plugin ( ) to provide some extra functionality on top of the raw WebSocket object.

How to use

Simply include the source. You will be able to construct a moosockets instance as follows:

var ms= new MooSocket({
  url : "ws://localhost:8081",
  onopen : function () {
  onmessage : function (data) { 
    console.log('received data');

  onclose : function (event) {

You should provide implementations of each of these callback functions as appropriate to your needs.

To send data to the server do the following:


If you wish to use logging (handy for diagnostics) then set the 'loggingEnabled' option to 'true'. (You can also override the default logging behaviour by also passing a function as the 'logger' option.)