Crate camo

Crate camo 

Source
Expand description

§camo

A Rust library for generating Camo-compatible signed URLs.

Camo is an SSL image proxy that routes images through HTTPS to prevent mixed content warnings on secure pages.

§Quick Start

use camo::CamoUrl;

let camo = CamoUrl::new("your-secret-key");

// Generate a signed URL
let signed_url = camo.sign("http://example.com/image.png");
println!("{}", signed_url.to_url("https://camo.example.com"));
// Output: https://camo.example.com/abc123.../68747470...

// Or use the builder pattern
let url = camo.sign("http://example.com/image.png")
    .base64()
    .to_url("https://camo.example.com");

§URL Formats

The library supports two encoding formats:

  • Hex (default): URL is encoded as hexadecimal
  • Base64: URL is encoded as URL-safe base64

Generated URLs follow the format: <base>/<digest>/<encoded_url>

Structs§

CamoUrl
Camo URL generator
SignedUrl
A signed Camo URL ready for use

Enums§

Encoding
URL encoding format