$client = new \swoole_client(\SWOOLE_SOCK_TCP,\SWOOLE_SOCK_SYNC);
$client->set([
"http_proxy_host" => "123.131.44.231",
"http_proxy_port" => 9999,
//// "socks5_host" => "121.31.150.165",
//// "socks5_port" => 6666,
]);
if ($client->connect("www.baidu.com", 80, 10)) {
$client->send("GET / HTTP/1.1\r\n\r\n");
sleep(1);
var_dump($client->recv());
var_dump(socket_strerror($client->errCode));
echo "success";
}else {
echo "err";
}
PHP Warning: SwooleClient::connect (): connect to server [www.baidu.com:80] failed. Error: Operation now in progress [115]. In / home/saylor/workspace/proxy_server/test.php on line 16