library camo-url-generator
A library that generates URLs for usage with camo TLS image proxy.
jdreesen/camo-url-generator
A library that generates URLs for usage with camo TLS image proxy.
- Thursday, September 10, 2015
- by jdreesen
- Repository
- 1 Watchers
- 0 Stars
- 12 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
Camo URL Generator
, (*1)
A PHP library that generates camouflaged URLs for usage with camo or go-camo TLS image proxy., (*2)
Installation
Just run, (*3)
$ composer require jdreesen/camo-url-generator
Example
use Dreesen\Image\HexCamo;
use Dreesen\Image\HttpOnlyCamo;
$camo = new HttpOnlyCamo(new HexCamo('https://img.example.org', 'secret'));
echo $camo->camouflage('http://example.org/image.jpg');
The secret
is the same HMAC key you used on your camo server instance running on https://img.example.org
., (*4)
What's inside?
-
Dreesen\Image\Camo
: Interface for your type-hinting which is implemented by all the following classes.
-
Dreesen\Image\HexCamo
: Generates URLs for usage with the camo or go-camo image proxy in HEX format.
-
Dreesen\Image\Base64Camo
: Generates URLs for usage with the go-camo image proxy in Base64 format.
-
Dreesen\Image\QueryStringCamo
: Generates URLs for usage with the camo image proxy in query string format.
-
Dreesen\Image\HttpOnlyCamo
: Decorator to only camouflage HTTP (non-secure) URLs.
-
Dreesen\Image\NoCamo
: Disables image camouflage by returning given URLs as they are.
Credit
Thanks to Corey Donohoe for creating Camo
and to cactus for the GoLang port of Camo., (*5)
License
All contents of this package are licensed under the MIT license., (*6)