mirror of
https://github.com/gnh1201/caterpillar.git
synced 2024-11-26 15:31:45 +00:00
Update proxytest.php
This commit is contained in:
parent
a3ef0fe6c9
commit
58562c835e
|
@ -8,16 +8,15 @@ ini_set("default_socket_timeout", 1); // must be. because of `feof()` works
|
|||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
$buffer_size = $data['chunksize'];
|
||||
$out = base64_decode($data['data']);
|
||||
|
||||
$port = intval($data['port']);
|
||||
$hostname = $data['server'];
|
||||
// TODO: HTTPS support
|
||||
/*
|
||||
if ($port == 443) {
|
||||
$hostname = "ssl://" . $hostname;
|
||||
}
|
||||
*/
|
||||
$scheme = $data['scheme'];
|
||||
|
||||
$hostname = $data['server'];
|
||||
if ($scheme == "https") {
|
||||
$hostname = sprintf("tls://%s:%s", $hostname, $port);
|
||||
}
|
||||
$fp = fsockopen($hostname, $port, $errno, $errstr, 1);
|
||||
|
||||
if (!$fp) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user