Client for the MSAK multi-stream throughput measurement protocol
npm install @m-lab/msakJavaScript client library for the MSAK
multi-stream throughput measurement protocol.
A Node.js environment (preferably the latest LTS, 20.x)
is required.
``bashClone the repository
git clone https://github.com/m-lab/msak-js
cd msak-js
This will build the library and write the resulting UMD module in
dist/msak.jsHow to use
Include
msak.js in your HTML page:`html
`Create a new
msak.Client, specifying your client name and version and providing your custom callbacks:`js
let client = new msak.Client(CLIENTNAME, CLIENTVERSION, {
onDownloadResult: (result) => {
console.log(result);
},
onDownloadMeasurement: (measurement) => {
console.log(measurement);
},
onUploadResult: (result) => {
console.log(result);
},
onUploadMeasurement: (measurement) => {
console.log(measurement);
},
onError: (err) => {
console.log("error: " + err);
}
});
``For a complete example, see index.html.