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.
- 🔗 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
cargo install webtranscat
git clone https://github.com/securityunion/webtranscat.git
cd webtranscat
cargo install --path .
# Connect to a WebTransport server (interactive mode)
webtranscat https://example.com:4443
# Connect with verbose logging
webtranscat -v https://example.com:4443
# Connect with insecure certificate verification (for testing)
webtranscat --insecure https://localhost:4443
# Listen-only mode (don't send stdin input)
webtranscat -u https://example.com:4443
# Exit after receiving one message
webtranscat -1 https://example.com:4443
# Multiple verbosity levels (like websocat)
webtranscat -vv https://example.com:4443 # Debug level
webtranscat -vvv https://example.com:4443 # Trace level
# Quiet mode (suppress diagnostic messages)
webtranscat -q https://example.com:4443
# Override logging with RUST_LOG
RUST_LOG=debug webtranscat https://example.com:4443
# Early startup debugging
WEBTRANSCAT_EARLY_LOG=1 webtranscat https://example.com:4443
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
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.
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)
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.
Contributions are welcome! Please feel free to submit a Pull Request.
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.
This tool is primarily intended for debugging and testing. While it supports secure connections, please review the security implications before using in production environments.