wtcat is a WebTransport CLI client for testing and debugging, similar to how wscat is used for WebSocket connections. It provides an easy way to connect to WebTransport servers, test authentication, and monitor real-time message streams.
- 🚀 Simple WebTransport connections - Connect to any WebTransport server
- 🔐 Flexible authentication - Support for JWT tokens, username/password, or no auth
- 📤 Custom payloads - Send arbitrary JSON messages on connection
- 📡 Real-time streaming - Monitor server messages in real-time
- 🔧 JSON mode - Pipe output to
jqand other tools - 🔒 TLS options - Support for self-signed certificates (development)
- ⚡ QUIC/HTTP3 - Built on modern WebTransport protocol
cargo install wtcatgit clone https://github.com/pervrosen/wtcat.git
cd wtcat
cargo install --path .wtcat --url https://localhost:4433 --no-auth -kwtcat --url https://localhost:4433 --token "your-jwt-token" -kwtcat --url https://localhost:4433 \
--username admin \
--password password \
--auth-url https://api.example.com/auth/login \
-kwtcat --url https://localhost:4433 --token "token" -j -k | jq '.type'wtcat - WebTransport CLI client for testing (like wscat for WebSocket)
Usage: wtcat [OPTIONS] --url <URL>
Options:
-u, --url <URL>
WebTransport server URL (e.g., https://localhost:4433 or https://localhost:4433/wt)
-t, --token <TOKEN>
JWT token for authentication (optional)
--username <USERNAME>
Username for authentication (requires --password and --auth-url)
-p, --password <PASSWORD>
Password for authentication (requires --username and --auth-url)
--auth-url <AUTH_URL>
Authentication endpoint URL (e.g., https://api.example.com/auth/login)
Required when using --username and --password
-s, --send <SEND>
Custom JSON payload to send on connection (e.g., '{"subscribe": "updates"}')
--no-auth
Skip authentication - connect without sending auth message
-k, --insecure
Skip TLS certificate verification (for self-signed certs)
-j, --json
Output only JSON (no decorative text, pipeable to jq)
--auth-timeout <AUTH_TIMEOUT>
Timeout for authentication response in seconds [default: 10]
-h, --help
Print help
-V, --version
Print version
wtcat --url https://localhost:4433/wt \
--token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
--insecurewtcat --url https://wt.example.com:4433 \
--username developer \
--password dev123 \
--auth-url https://api.example.com/auth/loginwtcat --url https://localhost:4433 \
--send '{"type":"subscribe","channel":"updates"}' \
--insecure \
--no-auth# Extract specific fields from all messages
wtcat --url https://localhost:4433 -t $TOKEN -j -k | jq '.timestamp'
# Filter messages by type
wtcat --url https://localhost:4433 -t $TOKEN -j -k | jq 'select(.type == "price_update")'
# Pretty print specific fields
wtcat --url https://localhost:4433 -t $TOKEN -j -k | jq '{type, value, timestamp}'# Connect to production server (with valid cert)
wtcat --url https://wt.production.com:443 --token $TOKEN
# Connect to staging (self-signed cert)
wtcat --url https://wt.staging.com:4433 --token $TOKEN -k
# Connect without any auth
wtcat --url https://test.local:4433 --no-auth -kwtcat supports multiple authentication methods:
Provide a JWT token directly if you already have one:
wtcat --url https://localhost:4433 --token "your-jwt-token"Let wtcat fetch a JWT token for you by authenticating against an HTTP API:
wtcat --url https://localhost:4433 \
--username admin \
--password secret \
--auth-url https://api.example.com/auth/loginThe auth endpoint should:
- Accept
POSTrequests with JSON:{"username": "...", "password": "..."} - Return JSON with one of:
token,access_token, orjwtfield
Send a custom JSON authentication message:
wtcat --url https://localhost:4433 \
--send '{"auth_type":"bearer","credentials":"xyz123"}'Connect without sending any authentication message:
wtcat --url https://localhost:4433 --no-authUse the -k or --insecure flag to skip certificate verification:
wtcat --url https://localhost:4433 -k --no-auth--insecure for development with self-signed certificates. Never use it in production!
For production servers with CA-signed certificates, simply omit the -k flag:
wtcat --url https://wt.example.com:443 --token $TOKENUse -j or --json to output only JSON messages without decorative text. Perfect for piping to other tools:
# Basic JSON output
wtcat --url https://localhost:4433 -t $TOKEN -j -k
# With jq for filtering
wtcat --url https://localhost:4433 -t $TOKEN -j -k | jq '.value'
# Save to file
wtcat --url https://localhost:4433 -t $TOKEN -j -k > messages.jsonl
# Process with other tools
wtcat --url https://localhost:4433 -t $TOKEN -j -k | grep "error"Error: Connection refused (os error 61)
Solution: Ensure the WebTransport server is running and accessible at the specified URL and port.
Error: invalid peer certificate: UnknownIssuer
Solution: Use the --insecure flag for self-signed certificates:
wtcat --url https://localhost:4433 -k --no-auth❌ Timeout waiting for authentication response (10s)
Solutions:
- Check if the server is responding to authentication requests
- Verify your token is valid and not expired
- Increase timeout with
--auth-timeout 30 - Try with
--no-authto test basic connectivity first
Error: peer doesn't support any known protocol
Solution: The server must support HTTP/3 ALPN protocol (h3). Ensure your server is configured for WebTransport/HTTP3.
wtcat uses the QUIC protocol (HTTP/3) to establish WebTransport connections:
┌─────────┐ ┌─────────┐
│ wtcat │ │ Server │
└────┬────┘ └────┬────┘
│ │
│ 1. QUIC connection (TLS 1.3) │
│──────────────────────────────────>│
│ │
│ 2. Open bidirectional stream │
│──────────────────────────────────>│
│ │
│ 3. Send auth/custom message │
│──────────────────────────────────>│
│ │
│ 4. Receive response │
│<──────────────────────────────────│
│ │
│ 5. Stream messages │
│<══════════════════════════════════│
│ (real-time updates) │
│ │
| Feature | wtcat (WebTransport) | wscat (WebSocket) |
|---|---|---|
| Protocol | QUIC/HTTP3 | TCP/HTTP1.1 or HTTP/2 |
| Encryption | TLS 1.3 (mandatory) | Optional (ws/wss) |
| Latency | Lower (0-RTT) | Higher |
| Head-of-line blocking | No | Yes |
| Multiplexing | Native | Via HTTP/2 |
| Mobile-friendly | Yes (survives IP changes) | No |
| Browser support | ~75% (2025) | ~98% |
git clone https://github.com/pervrosen/wtcat.git
cd wtcat
cargo build --releasecargo testcargo run -- --url https://localhost:4433 --no-auth -kContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- wscat - WebSocket testing tool
- websocat - Advanced WebSocket client
- curl - HTTP client (supports HTTP/3 in newer versions)
- h2load - HTTP/2 and HTTP/3 load testing tool
Made with ❤️ by the Rust community