sockjs-client
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -56,3 +56,3 @@ (function (parent) { | ||
function SockJSClient (server) { | ||
var parsed, pathname, serverId, sessionId; | ||
var parsed, serverId, sessionId; | ||
@@ -69,8 +69,5 @@ parsed = url.parse(server); | ||
pathname = parsed.pathname; | ||
while (undefined !== pathname && | ||
'/' === pathname.charAt(pathname.length - 1)) { | ||
pathname = pathname.slice(0, pathname.length - 1); | ||
if (parsed.pathname === '/') { | ||
parsed.pathname = ''; | ||
} | ||
parsed.pathname = pathname; | ||
@@ -272,3 +269,2 @@ serverId = Math.round(Math.random() * 999); | ||
this.partialChunk = chunk.slice(2); | ||
console.log("thud"); | ||
break; | ||
@@ -275,0 +271,0 @@ case 'a': // data |
{ | ||
"name": "sockjs-client", | ||
"author": "Matthew Sackman", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"keywords": ["websockets", "websocket"], | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -5,1 +5,10 @@ # SockJS Client Node | ||
the XHR Streaming transport is supported. | ||
## Usage | ||
var sjsc = require('sockjs-client'); | ||
var client = sjsc.create("http://localhost/sjsServer"); | ||
client.on('connection', function () { // connection is established }); | ||
client.on('data', function (msg) { // received some data }); | ||
client.on('error', function (e) { // something went wrong }); | ||
client.write("Have some text you mighty SockJS server!"); |
13006
14
334