Comparing version 2.0.2 to 2.0.3
@@ -83,25 +83,25 @@ 'use strict'; | ||
}); | ||
wsServer.on('request', function(request) { | ||
wsServer.on('request', function(request) | ||
{ | ||
// explicity omitting origin check here. | ||
var connection = request.accept(null, request.origin); | ||
log.debug(' Connection accepted.'); | ||
connection.on('message', function(message) | ||
{ | ||
if (message.type === 'utf8') | ||
var connection = request.accept(null, request.origin); | ||
log.debug(' Connection accepted.'); | ||
connection.on('message', function(message) | ||
{ | ||
log.debug('Received Message: ' + message.utf8Data); | ||
connection.sendUTF(message.utf8Data); | ||
} | ||
else if (message.type === 'binary') | ||
if (message.type === 'utf8') | ||
{ | ||
log.debug('Received Message: ' + message.utf8Data); | ||
connection.sendUTF(message.utf8Data); | ||
} | ||
else if (message.type === 'binary') | ||
{ | ||
log.debug('Received Binary Message of ' + message.binaryData.length + ' bytes'); | ||
connection.sendBytes(message.binaryData); | ||
} | ||
}); | ||
connection.on('close', function() | ||
{ | ||
log.debug('Received Binary Message of ' + message.binaryData.length + ' bytes'); | ||
connection.sendBytes(message.binaryData); | ||
} | ||
log.info('Peer %s disconnected', connection.remoteAddress); | ||
}); | ||
}); | ||
connection.on('close', function(reasonCode, description) { | ||
console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.'); | ||
}); | ||
}); | ||
return server; | ||
@@ -178,3 +178,3 @@ }; | ||
{ | ||
log.info('Headers for %s: %s', request.method, util.inspect(request.headers)); | ||
log.info('Headers for %s to %s: %s', request.method, request.url, util.inspect(request.headers)); | ||
if (request.body) | ||
@@ -181,0 +181,0 @@ { |
{ | ||
"name": "loadtest", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Run load tests for your web application. Mostly ab-compatible interface, with an option to force requests per second. Includes an API for automated load testing.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/loadtest", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2144
78636