var fork = require('child_process').fork;
var async = require('async');
var amountConcurrentUsers = process.argv[2] || 200;
var host = process.argv[3] || 'http://localhost';
var initialPort = process.argv[4] || 3000;
var totalServers = process.argv[5] || 50;
var Client = require('./client');

var clientIdentifiers = [];
var clients = [];

for(var i = 0; i < amountConcurrentUsers; i++) {
    clientIdentifiers.push(i);
};

console.log('Here we go');
console.log('amountConcurrentUsers: ' + amountConcurrentUsers);
console.log('Host: ' + host);
console.log('Initial port: ' + initialPort);

for(var j = 0; j < totalServers; j++) {
    var port = initialPort + j;
    console.log('connecting to port: ' + port);
    async.each(clientIdentifiers, function(clientIdentifier) {
        // clients[clientIdentifier] = fork('client.js', [host, port, clientIdentifier] );
        console.log('Client: ' + clientIdentifier);
        clients[clientIdentifier] = Client(host, port, port + '-' + clientIdentifier);
    }, function(err){
        console.log('UPSSS! Error!');
    });
}



@@ -285,16 +285,45 @@
 lient');
+%0Avar defaultHAProxyPort = 80;
 %0A%0Avar cl
@@ -668,16 +668,82 @@
 r port =
+  (isHAProxyPort(defaultHAProxyPort, port)) ? defaultHAProxyPort :
  initial
@@ -769,17 +769,17 @@
 le.log('
-c
+C
 onnectin
@@ -1165,8 +1165,101 @@
 %7D);%0A%7D%0A%0A%0A
+function isHAProxyPort(defaultHAProxyPort, port) %7B%0A%0A    return port === defaultHAProxyPort;%0A%7D

Add default port for HAProxy