You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
21
vendor/swoole/examples/http/https_proxy.php
vendored
Executable file
21
vendor/swoole/examples/http/https_proxy.php
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
Swoole\Async::dnsLookup("www.baidu.com", function ($domainName, $ip) {
|
||||
//Swoole\Async::dnsLookup("www.baidu.com", function ($domainName, $ip) {
|
||||
$cli = new swoole_http_client($ip, 443,true);
|
||||
$cli->set(array(
|
||||
'http_proxy_host'=>"127.0.0.1",
|
||||
'http_proxy_port'=>3128,
|
||||
|
||||
));
|
||||
$cli->setHeaders([
|
||||
'Host' => $domainName,
|
||||
"User-Agent" => 'Chrome/49.0.2587.3',
|
||||
]);
|
||||
$cli->get('/', function ($cli) {
|
||||
echo "Length: " . strlen($cli->body) . "\n";
|
||||
echo $cli->body;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user