ws-ping-0.1.0 is not a library.
ws-ping
ws-ping is a command-line utility written in Rust for pinging WebSocket servers and measuring their latency. It functions similarly to the traditional ping command but is tailored for WebSocket connections, sending WebSocket Ping frames and awaiting Pong responses.
Features
- Ping any WebSocket URL (
ws://orwss://). - Specify the number of pings to send.
- Set the interval between pings.
- Detailed output including Round Trip Time (RTT), minimum, maximum, average latency, and mean deviation.
Installation
To install ws-ping, you need to have Rust and Cargo installed on your system.
Usage
Arguments
<URL>: The WebSocket URL to ping (e.g.,ws://echo.websocket.eventsorwss://stream.binance.com:9443/ws/btcusdt@depth).
Options
-c,--count <COUNT>: Number of pings to send. Defaults to4.-i,--interval <INTERVAL>: Interval between pings in seconds. Defaults to1.
Examples
-
Basic ping to a WebSocket echo server:
-
Ping a secure WebSocket with 10 pings and a 0.5-second interval:
-
Ping with default options:
Repository
The source code for ws-ping is available on GitHub: https://github.com/maggnus/websocket-ping
License
This project is licensed under the MIT License. See the LICENSE file for details.