jdreesen/camo-url-generator

一个用于与 camo TLS 图片代理一起使用的 URL 生成库。

v1.0.0 2015-07-20 20:09 UTC

This package is auto-updated.

Last update: 2024-09-05 18:56:41 UTC


README

Build Status License

一个用于与 camogo-camo TLS 图片代理一起使用的 PHP 库,用于生成伪装 URL。

安装

只需运行

$ composer require jdreesen/camo-url-generator

示例

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');

secret 是你在运行在 https://img.example.org 的 camo 服务器实例上使用的相同的 HMAC 密钥。

里面有什么?

  • Dreesen\Image\Camo:接口,用于你的类型提示,由以下所有类实现。
  • Dreesen\Image\HexCamo:为使用 camogo-camo 图片代理生成 HEX 格式的 URL。
  • Dreesen\Image\Base64Camo:为使用 go-camo 图片代理生成 Base64 格式的 URL。
  • Dreesen\Image\QueryStringCamo:为使用 camo 图片代理生成查询字符串格式的 URL。
  • Dreesen\Image\HttpOnlyCamo:装饰器,仅用于伪装 HTTP(非安全)URL。
  • Dreesen\Image\NoCamo:通过返回原始 URL 来禁用图像伪装。

致谢

感谢 Corey Donohoe 创建 Camo,以及 cactus 为 Camo 提供了 GoLang 版本。

许可

本包所有内容均受 MIT 许可证 许可。