Live Example
Back to protocolA live JTP server is running at jtp.mattt.space:8443 serving 7 images. Use this to test your client implementation against a real server with valid TLS certificates.
# Live Server
| Host | jtp.mattt.space |
| Port | 8443 |
| TLS | Enabled (Let's Encrypt) |
| Images | 7 files (~47 MB total) |
The server uses a valid Let's Encrypt certificate, so the client can use standard CA roots (no custom --cert needed).
# Connect
Clone the repository and build the client:
git clone https://github.com/punctuations/jtp cd jtp cargo build --release
Connect to the live server:
# List available images ./target/release/client jtp://jtp.mattt.space # Download all images to ./output ./target/release/client jtp://jtp.mattt.space --out ./output # With keep-alive for faster downloads ./target/release/client jtp://jtp.mattt.space -k # Parallel download (4 workers) ./target/release/client jtp://jtp.mattt.space -p 4 # Delta sync (only download missing images) ./target/release/client jtp://jtp.mattt.space --batch
# Image Catalog
The server hosts these 7 images:
| Filename | Type | Size | Compressed |
|---|---|---|---|
| bateman.jpg | JPEG | 178 KB | No |
| derulo.png | PNG | 1.4 MB | No |
| momoa.bmp | BMP | 43 MB | Yes (Zstd) |
| segel.jpeg | JPEG | 217 KB | No |
| statham.webp | WebP | 174 KB | No |
| sudeikis.jpg | JPEG | 54 KB | No |
| voorhees.gif | GIF | 2.4 MB | No |
Sudeikis ImageID
The sudeikis.jpg file has ImageID:
- Full (16 hex): 092ad684f90cbe12
- Short (8 hex): 092ad684
# Protocol Examples
LIST Request
Send bytes 01 00 (ReqType=LIST, no keep-alive) to receive the catalog of 7 images.
# Response starts with: 4A 54 50 4C # "JTPL" header 00 07 # Count = 7 images # Followed by 7 catalog entries...
Expected Output
$ ./target/release/client jtp://jtp.mattt.space Server catalog: - a1b2c3d4e5f67890 bateman.jpg 178234 bytes - b2c3d4e5f6789012 derulo.png 1468921 bytes - c3d4e5f678901234 momoa.bmp 45088054 bytes - d4e5f67890123456 segel.jpeg 222187 bytes - e5f6789012345678 statham.webp 178432 bytes - f67890123456789a sudeikis.jpg 55291 bytes - 7890123456789abc voorhees.gif 2516482 bytes Downloaded 7 images in 3.2s (2.2 images/sec)
Note: ImageIDs shown above are examples. Actual IDs are computed from file contents.
Verbose Mode
$ ./target/release/client jtp://jtp.mattt.space -v Client args: addr=jtp.mattt.space:8443, server_name=jtp.mattt.space, cert=None, ... Using system root certificates... Connecting TCP to jtp.mattt.space:8443... TLS handshake complete TLS connected; sending LIST request LIST response header OK (JTPL) LIST count=7 ...
# Run Locally
To run your own server with the same images:
# Terminal 1: Start the server cargo run --release --bin server -- --images images --verbose # Terminal 2: Connect with client (plain TCP for local testing) cargo run --release --bin client -- --no-tls --addr 127.0.0.1:8443
For TLS locally, the server auto-generates self-signed certificates (cert.pem, key.pem). Pass --cert cert.pem to the client.