// ZeroTier distributed HTTP test agent // --------------------------------------------------------------------------- // Customizable parameters: // Maximum test duration in milliseconds var TEST_DURATION = (30 * 1000); // Interval between tests (should be several times longer than TEST_DURATION) var TEST_INTERVAL = (60 * 2 * 1000); // Where should I contact to register and query a list of other test agents? var SERVER_HOST = '104.238.141.145'; var SERVER_PORT = 18080; // Which port should agents use for their HTTP? var AGENT_PORT = 18888; // Payload size in bytes var PAYLOAD_SIZE = 100000; // --------------------------------------------------------------------------- var ipaddr = require('ipaddr.js'); var os = require('os'); var http = require('http'); var async = require('async'); var express = require('express'); var app = express(); // Find our ZeroTier-assigned RFC4193 IPv6 address var thisAgentId = null; var interfaces = os.networkInterfaces(); if (!interfaces) { console.error('FATAL: os.networkInterfaces() failed.'); process.exit(1); } for(var ifname in interfaces) { var ifaddrs = interfaces[ifname]; if (Array.isArray(ifaddrs)) { for(var i=0;i