forked from PureDark/HProxy-PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
35 lines (31 loc) · 959 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
//定义编码
header( "Content-Type:text/plain;charset=utf-8");
include("class.steal.php");
$steal = new Steal("file_get_contents");
$headers = get_all_headers();
if(isset($headers["Origin-Url"])&&!empty($headers["Origin-Url"])){
$originUrl = urldecode($headers["Origin-Url"]);
$referer = (isset($headers["Referer"]))?$headers["Referer"]:"";
$cookie = (isset($headers["Cookie"]))?$headers["Cookie"]:"";
echo $steal->getCode($originUrl, $referer, $cookie);
}else{
foreach($headers as $key => $value) {
echo "<!--$key => $value-->\r\n";
}
}
function get_all_headers() {
$headers = array();
foreach($_SERVER as $key => $value) {
if(substr($key, 0, 5) === 'HTTP_') {
$key = substr($key, 5);
$key = strtolower($key);
$key = str_replace('_', ' ', $key);
$key = ucwords($key);
$key = str_replace(' ', '-', $key);
$headers[$key] = $value;
}
}
return $headers;
}
?>