Skip to content

Instantly share code, notes, and snippets.

@NoUsername
NoUsername / websocket_loadtester.js
Created January 16, 2013 07:32
a simple load tester for websocket server which connects a desired number of clients, sends "client _RANDOM_UNIQUE_ID_" and then in a given interval "ping _RANDOM_NUMBER_" prints out any messages sent by the server
#!/usr/bin/env node
// to run install: nodejs and the module "websocket"
// npm install websocket
// then execute
// node tester.js _NUMBER_OF_CLIENTS_
var WebSocketClient = require('websocket').client;
var HOST = 'ws://localhost:8449/ws/endpoint';
var PING_TIME_MS = 20000;