webtranscat
A WebTransport equivalent of websocat
- a command-line WebTransport client for debugging and testing.
webtranscat was originally developed to debug videocall.rs, a WebRTC video calling application that uses WebTransport for data channels.
Features
- 🔗 WebTransport Client: Connect to WebTransport servers using QUIC
- 📡 Datagram Support: Send and receive unreliable datagrams
- 🌊 Stream Support: Handle reliable unidirectional streams
- 🔄 Bidirectional: Echo incoming data and send stdin input
- 🔧 websocat-like CLI: Familiar interface for websocat users
- 🛡️ Security Options: Support for both secure and insecure connections
- 📊 Verbose Logging: Multiple verbosity levels for debugging
Installation
From crates.io
From source
Usage
Basic Examples
# Connect to a WebTransport server (interactive mode)
# Connect with verbose logging
# Connect with insecure certificate verification (for testing)
# Listen-only mode (don't send stdin input)
# Exit after receiving one message
# Multiple verbosity levels (like websocat)
# Quiet mode (suppress diagnostic messages)
Environment Variables
# Override logging with RUST_LOG
RUST_LOG=debug
# Early startup debugging
WEBTRANSCAT_EARLY_LOG=1
Command Line Options
Usage: webtranscat [OPTIONS] <URL>
Arguments:
<URL> WebTransport URL to connect to
Options:
-v... Increase verbosity level to info or further
-q Suppress all diagnostic messages, except of startup errors
--insecure Skip certificate verification (insecure)
-u, --unidirectional Only listen for incoming data, don't send from stdin
-1, --one-message Exit after receiving one message
-h, --help Print help
-V, --version Print version
How it Works
webtranscat establishes a WebTransport connection and concurrently:
- Listens for incoming datagrams - unreliable, unordered packets (UDP-like but encrypted)
- Accepts unidirectional streams - reliable, ordered byte streams (TCP-like but multiplexed)
- Sends stdin input as datagrams - user input becomes outgoing datagrams (unless
-u
is used)
All received data is echoed to stdout with newlines, making it easy to see what's being received.
Logging Levels
Following websocat's logging approach:
- No flags:
WARN
level (warnings + errors only) -v
:INFO
level (connection info + warnings + errors)-vv
:DEBUG
level (detailed debugging info)-vvv+
:TRACE
level (everything)
Development Origin
This tool was created to debug videocall.rs, a WebRTC video calling application that leverages WebTransport for efficient data channel communication. During development, we needed a simple way to test WebTransport connections, inspect datagrams and streams, and debug connectivity issues.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Disclaimer
This tool is primarily intended for debugging and testing. While it supports secure connections, please review the security implications before using in production environments.