LCL Speedtest is a cross-platform Speedtest client-side library written in Swift. The library is a community implementation of NDT7 protocol from M-Lab.
Please follow the policy and rules from M-Lab when using the measurement resources.
- Swift 5.7+
- macOS 10.15+, iOS 14+, Linux
Add the following to your Package.swift
file:
.package(url: "https://github.com/Local-Connectivity-Lab/lcl-speedtest.git", from: "1.0.0")
Then import the module to your project
.target(
name: "YourAppName",
.dependencies: [
.product(name: "LCLSpeedtest", package: "lcl-speedtest")
]
)
var testClient = SpeedTestClient()
testClient.onDownloadProgress = { measurement in
print(measurement)
}
testClient.onUploadProgress = { measurement in
print(measurement)
}
try await testClient.start(with: .downloadAndUpload)
- Measure download and upload throughputs through Websocket protocol.
- Fine tune upload throughput following the system capacity.
- Measurement supports cancellation.
Any contribution and pull requests are welcome! However, before you plan to implement some features or try to fix an uncertain issue, it is recommended to open a discussion first. You can also join our Discord channel, or visit our website.
LCL Speedtest is released under Apache License. See LICENSE for more details.