Comparing version 0.2.5 to 0.2.6
#!/usr/bin/env node | ||
'use strict'; | ||
@@ -18,3 +19,3 @@ /** | ||
// is there an url? if not, break and display help | ||
if(args._.length == 0) | ||
if(args._.length === 0) | ||
{ | ||
@@ -21,0 +22,0 @@ help(); |
#!/usr/bin/env node | ||
'use strict'; | ||
@@ -35,3 +36,3 @@ /** | ||
{ | ||
options.delay = parseInt(args.delay); | ||
options.delay = parseInt(args.delay, 10); | ||
} | ||
@@ -38,0 +39,0 @@ else |
@@ -57,1 +57,7 @@ | ||
### 2013-09-30: version 0.2.6 | ||
* Use the deployment module. | ||
* Correct support for https. | ||
@@ -10,9 +10,9 @@ 'use strict'; | ||
// requires | ||
require('./prototypes.js'); | ||
require('prototypes'); | ||
var testing = require('testing'); | ||
var urlLib = require('url'); | ||
var http = require('http'); | ||
var https = require('https'); | ||
var Log = require('log'); | ||
var timing = require('./timing.js'); | ||
var websocket = require('./websocket.js'); | ||
@@ -51,6 +51,4 @@ // globals | ||
{ | ||
if (params.agentKeepAlive) | ||
{ | ||
} | ||
options = urlLib.parse(params.url); | ||
log.info('Options: %j', options); | ||
options.headers = {}; | ||
@@ -134,3 +132,8 @@ if (!params.agent) | ||
var requestFinished = getRequestFinisher(id); | ||
var request = http.request(options, getConnect(id, requestFinished)); | ||
var lib = http; | ||
if (options.protocol == 'https:') | ||
{ | ||
lib = https; | ||
} | ||
var request = lib.request(options, getConnect(id, requestFinished)); | ||
if (message) | ||
@@ -237,9 +240,10 @@ { | ||
} | ||
if (options.url.startsWith('ws://')) | ||
if (options.url.startsWith('http:') || options.url.startsWith('https:')) | ||
{ | ||
constructor = websocket.WebSocketClient; | ||
constructor = HttpClient; | ||
} | ||
else if (options.url.startsWith('http')) | ||
else | ||
{ | ||
constructor = HttpClient; | ||
log.error('Invalid URL %s, must be http:// or https://', options.url); | ||
return; | ||
} | ||
@@ -246,0 +250,0 @@ options.concurrency = options.concurrency || 1; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
// requires | ||
require('./prototypes.js'); | ||
require('prototypes'); | ||
var loadtest = require('./loadtest.js'); | ||
@@ -13,0 +13,0 @@ var testserver = require('./testserver.js'); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
// requires | ||
require('./prototypes.js'); | ||
require('prototypes'); | ||
var http = require('http'); | ||
@@ -13,0 +13,0 @@ var util = require('util'); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
// requires | ||
require('./prototypes.js'); | ||
require('prototypes'); | ||
var testing = require('testing'); | ||
@@ -13,0 +13,0 @@ var util = require('util'); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
// requires | ||
require('./prototypes.js'); | ||
require('prototypes'); | ||
var WebSocketClient = require('websocket').client; | ||
@@ -13,0 +13,0 @@ var testing = require('testing'); |
{ | ||
"name": "loadtest", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"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.", | ||
@@ -14,2 +14,3 @@ "homepage": "https://github.com/alexfernandez/loadtest", | ||
"dependencies": { | ||
"prototypes": "*", | ||
"websocket": "*", | ||
@@ -16,0 +17,0 @@ "testing": "*", |
@@ -23,3 +23,3 @@ 'use strict'; | ||
var tests = {}; | ||
var libs = [ 'prototypes', 'timing', 'sample', 'websocket', 'loadtest' ]; | ||
var libs = [ 'timing', 'sample', 'websocket', 'loadtest' ]; | ||
libs.forEach(function(lib) | ||
@@ -26,0 +26,0 @@ { |
Sorry, the diff of this file is not supported yet
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
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
44501
6
16
1361
5
3
+ Addedprototypes@*
+ Addedprototypes@3.0.3(transitive)