Skip to content
This repository was archived by the owner on Oct 10, 2018. It is now read-only.

Commit 83ba9b9

Browse files
author
dafnarosenblum
committed
Add support in primus non default pathname
1 parent a6a3c26 commit 83ba9b9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

index.js

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ program
1717
.option('-o, --output <output>', 'Output file')
1818
.option('-t, --type <type>', 'type of websocket server to bench(socket.io, engine.io, faye, primus, wamp). Default to io')
1919
.option('-p, --transport <type>', 'type of transport to websocket(engine.io, websockets, browserchannel, sockjs, socket.io). Default to websockets')
20+
.option('-n, --pathname <type>', 'pathname for primus configuration, default is "/primus" ')
2021
.option('-k, --keep-alive', 'Keep alive connection')
2122
.option('-v, --verbose', 'Verbose Logging')
2223
.parse(process.argv);
@@ -74,7 +75,8 @@ var options = {
7475
type : program.type,
7576
transport : program.transport,
7677
keepAlive : program.keepAlive,
77-
verbose : program.verbose
78+
verbose : program.verbose,
79+
pathname : program.pathname
7880
};
7981

8082
if (program.verbose) {

lib/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Benchmark.prototype.launch = function (connectNumber, concurency, workerNumber,
3636
for (var i = 0; i < workerNumber; i++) {
3737

3838
this.workers[i] = cp.fork(__dirname + '/worker.js', [
39-
this.server, this.options.generatorFile, this.options.type, this.options.transport, this.options.verbose
39+
this.server, this.options.generatorFile, this.options.type, this.options.transport, this.options.verbose,
40+
this.options.pathname
4041
]);
4142

4243
this.workers[i].on('message', this._onMessage.bind(this));

lib/workers/primusworker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var BaseWorker = require('./baseworker.js'),
77
logger = require('../logger.js');
88

99
// Create a primus instance in order to obtain the client constructor.
10-
var PrimusClient = new Primus(http.createServer(), {'transformer' : process.argv[5]}).Socket;
10+
var PrimusClient = new Primus(http.createServer(), {'transformer' : process.argv[5] , pathname: process.argv[7]}).Socket;
1111

1212
var PrimusWorker = function (server, generator) {
1313
PrimusWorker.super_.apply(this, arguments);

0 commit comments

Comments
 (0)