arsonik/secret-redirect

隐藏广告重定向

v2.1.2 2018-01-23 15:59 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:20:53 UTC


README

Latest Stable Version

一种客户端请求的隐蔽转发方式。

安装

composer require arsonik/secret-redirect
require './vendor/autoload.php';

使用

使用Location头(302状态)转发客户端

$secret = new SecretRedirect();
$secret->cookiePrefix = 'm2sa_';
$secret->redirect('http://ads-server.tld/campaign?id=xxxx', 'http://fallback.tld/azz');
exit;

返回Location头URL

$secret = new SecretRedirect();
$secret->cookiePrefix = 'm2sa_';
$url = $secret->location('http://ads-server.tld/campaign?id=xxxx', 'http://fallback.tld/azz');

返回目标页面内容

$secret = new SecretRedirect();
$secret->cookiePrefix = 'm2sa_';
$content = $secret->content('http://ads-server.tld/campaign?id=xxxx');

可选配置

SecretRedirect类参数

  • cookiePrefix 字符串
  • forwardCookies 布尔值
  • serverUsesXHttpForwardedFor 布尔值
  • timeout 浮点数