-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Sh
committed
Apr 16, 2024
1 parent
77f05e2
commit 69a0b89
Showing
15 changed files
with
893 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
use Proxyrequest\ProxyRequestRotate; | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$proxyRequestRotate = new ProxyRequestRotate('http://proxyrequest.ru','i_am_a_test_token_i_can_intentionally_parse_only_proxyrequest_ru'); | ||
|
||
//echo $proxyRequestRotate->getProxyResponse(); | ||
echo $proxyRequestRotate->sendRequest(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<?php | ||
|
||
sleep(1000000); | ||
sleep(getrandmax()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
|
||
namespace Proxyrequest\Conract; | ||
|
||
interface ProxyRequestInterface | ||
{ | ||
public function sendRequest(); | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
namespace Proxyrequest\Response; | ||
|
||
class ProxyResponse | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
public $success; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $content; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $url; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $content_type; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $http_code; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $request_size; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $size_download; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $download_content_length; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $effective_method; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $request_header; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $scheme; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $primary_ip; | ||
|
||
|
||
public $keys = []; | ||
|
||
public function __construct($dataInJson) | ||
{ | ||
$this->success = 0; | ||
|
||
$response = json_decode($dataInJson, true); | ||
|
||
foreach ($response as $key => $val) { | ||
$this->{$key} = $val; | ||
$this->keys[] = $key; | ||
} | ||
} | ||
|
||
public function __toString() | ||
{ | ||
return json_encode($this->getValue()); | ||
} | ||
|
||
public function getValue() | ||
{ | ||
return array_map(function ($key) { | ||
return [$key => $this->{$key}]; | ||
}, $this->keys); | ||
} | ||
} |
Oops, something went wrong.