You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
20
vendor/swoole/examples/http/http_proxy_auth.php
vendored
Executable file
20
vendor/swoole/examples/http/http_proxy_auth.php
vendored
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$cli = new swoole_http_client('127.0.0.1', 80);
|
||||
$cli->set(array(
|
||||
'http_proxy_host' => "127.0.0.1",
|
||||
'http_proxy_port' => 33080,
|
||||
'http_proxy_user' => 'test',
|
||||
'http_proxy_password' => 'test',
|
||||
));
|
||||
$cli->setHeaders([
|
||||
'Host' => "localhost",
|
||||
"User-Agent" => 'Chrome/49.0.2587.3',
|
||||
]);
|
||||
$cli->get('/', function ($cli) {
|
||||
echo "Length: " . strlen($cli->body) . ", statusCode=".$cli->statusCode."\n";
|
||||
$cli->close();
|
||||
echo $cli->body;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user