Comparing version 0.0.14 to 0.0.15
@@ -7,3 +7,3 @@ module.exports = { | ||
"request" : require('./WebSocketRequest'), | ||
"version" : "0.0.14" | ||
"version" : "0.0.15" | ||
}; |
@@ -180,4 +180,9 @@ /************************************************************************ | ||
var req = this.request = client.request(this.url.pathname, reqHeaders); | ||
var pathAndQuery = this.url.pathname; | ||
if (this.url.search) { | ||
pathAndQuery += this.url.search; | ||
} | ||
var req = this.request = client.request(pathAndQuery, reqHeaders); | ||
req.on('response', function(response) { | ||
@@ -184,0 +189,0 @@ s.failHandshake("Server responded with a non-101 status: " + response.statusCode); |
@@ -352,3 +352,3 @@ /************************************************************************ | ||
} | ||
console.error((new Date()) + " " + logCloseError); | ||
// console.error((new Date()) + " " + logCloseError); | ||
} | ||
@@ -355,0 +355,0 @@ else { |
@@ -120,2 +120,14 @@ /************************************************************************ | ||
WebSocketServer.prototype.broadcastUTF = function(utfData) { | ||
this.connections.forEach(function(connection) { | ||
connection.sendUTF(utfData); | ||
}); | ||
}; | ||
WebSocketServer.prototype.broadcastBytes = function(binaryData) { | ||
this.connections.forEach(function(connection) { | ||
connection.sendBytes(binaryData); | ||
}); | ||
}; | ||
WebSocketServer.prototype.shutDown = function() { | ||
@@ -122,0 +134,0 @@ this.unmount(); |
@@ -6,3 +6,3 @@ { | ||
"author": "Brian McKelvey <brian@worlize.com>", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -88,5 +88,2 @@ #!/usr/bin/env node | ||
var connections = []; | ||
var lorem = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."; | ||
@@ -100,4 +97,2 @@ | ||
connections.push(connection); | ||
connection.on('message', function(message) { | ||
@@ -141,7 +136,3 @@ if (message.type === 'utf8') { | ||
connection.on('close', function(connection) { | ||
var index = connections.indexOf(connection); | ||
if (index !== -1) { | ||
console.log((new Date()) + " peer " + connection.remoteAddress + " disconnected."); | ||
connections.splice(index, 1); | ||
} | ||
console.log((new Date()) + " peer " + connection.remoteAddress + " disconnected."); | ||
}); | ||
@@ -148,0 +139,0 @@ |
290922
42
7258