Skip to content

Instantly share code, notes, and snippets.

@AndyMoreland
Created April 26, 2012 22:06
Show Gist options
  • Save AndyMoreland/2503575 to your computer and use it in GitHub Desktop.
Save AndyMoreland/2503575 to your computer and use it in GitHub Desktop.
$( function () {
var ws = new WebSocket("ws://localhost:3001/sockjs/websocket");
ws.onopen = function() {
ws.send('{"msg":"connect","id":"1"}');
ws.send('{"msg":"method","method":"pageHit","params":["'+window.location.href+'","'+document.referrer+'","'+document.title+'"],"id":"2"}');
ws.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment