ws-ping

Crates.iows-ping
lib.rsws-ping
version0.1.0
created_at2025-07-09 05:14:11.464056+00
updated_at2025-07-09 05:14:11.464056+00
descriptionA simple WebSocket ping utility
homepage
repositoryhttps://github.com/maggnus/websocket-ping
max_upload_size
id1744242
size44,855
Maksim Korenev (maggnus)

documentation

README

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:// or wss://).
  • 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.

cargo install ws-ping

Usage

ws-ping <URL> [OPTIONS]

Arguments

  • <URL>: The WebSocket URL to ping (e.g., ws://echo.websocket.events or wss://stream.binance.com:9443/ws/btcusdt@depth).

Options

  • -c, --count <COUNT>: Number of pings to send. Defaults to 4.
  • -i, --interval <INTERVAL>: Interval between pings in seconds. Defaults to 1.

Examples

  1. Basic ping to a WebSocket echo server:

    ws-ping ws://echo.websocket.events
    
  2. Ping a secure WebSocket with 10 pings and a 0.5-second interval:

    ws-ping wss://stream.binance.com:9443/ws/btcusdt@depth -c 10 -i 0.5
    
  3. Ping with default options:

    ws-ping wss://your-websocket-server.com/ws
    

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.

Commit count: 0

cargo fmt