
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
aws-latency-check
Advanced tools
#AWS Latency Check
This module will take an object of AWS endpoints and run a check against each to find the closest one.
This check will run against the /ping
endpoint for the AWS service endpoints provided. For this reason not all AWS services are valid. Valid services include:
Used to create an instance of the object.
regions
: This whould be an object of each region to check. Key should be the region_id and the value should be the hostname of the region to check. Each region must have a reachable endpoint of http://[hostname]/ping
.options
: Various options for the test.
timeout
: The max amount of time that can be passed when checking any one region. This defaults to 4000.Called to actually begin the process. After a check has been completed if you wish to re-check you can call this method again.
Fired after the entire check is completed.
checker.on('complete', function (results) {
console.log(results);
});
results
: An array of each region results (ordered by lowest latency).[
{ region: 'us-east-1', latency: 123 },
{ region: 'us-west-1', latency: 187 },
{ region: 'us-west-2', latency: 198 },
{ region: 'eu-central-1', latency: 293 },
{ region: 'ap-northeast-1', latency: 385 },
{ region: 'sa-east-1', latency: 406 },
{ region: 'ap-southeast-1', latency: 515 },
{ region: 'ap-southeast-2', latency: 754 },
{ region: 'eu-west-1', latency: null }
]
After a region is complete.
checker.on('region_results', function (progress, results) {
console.log(results);
});
progress
: The total percentage completed for the test. This can be used to update a progress bar etc.results
: Object of the region results.{ region: 'us-west-1', latency: 162 },
If an error was thrown and the test is stopped.
checker.on('error', function (err) {
console.log(err);
});
err
: The actual error message.region
: The region that was tested.latency
: The calculated latency. If there was an error this will be null
.{ region: 'us-west-1', latency: 162, status_code: 200 }
// Require the library
var LatencyCheck = require('LatencyCheck');
// Define the regions to check.
var regions = {
"us-east-1": "ec2.us-east-1.amazonaws.com",
"us-west-1": "ec2.us-west-1.amazonaws.com",
"ap-southeast-1": "ec2.ap-southeast-1.amazonaws.com",
"us-west-2": "ec2.us-west-2.amazonaws.com",
"sa-east-1": "ec2.sa-east-1.amazonaws.com",
"eu-central-1": "ec2.eu-central-1.amazonaws.com",
"eu-west-1": "ec2.eu-west-1.amazonaws.com",
"ap-northeast-1": "ec2.ap-northeast-1.amazonaws.com",
"ap-southeast-2": "ec2.ap-southeast-2.amazonaws.com"
};
// Create an instance of the object
var checker = new LatencyCheck(regions);
// Call the begin function
checker.begin();
// Listen for the check to complete.
checker.on('check_complete', function (results) {
console.log(results);
});
// Listen for each region check to complete.
checker.on('region_complete', function (progress, results) {
console.log('Current porogress': progress + '% complete');
console.log(results);
});
// Listen for any errors so we can take the appropriate action
checker.on('error', function (err) {
console.log(err);
});
FAQs
Checks the latency to various AWS endpoints.
We found that aws-latency-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.