作者:鹏大1111 | 来源:互联网 | 2023-08-31 13:30
123456789101112131415161718192021222324252627282930public function swooleSocket() { go(fun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public function swooleSocket()
{
go(function() {
$domain = 'tls://www.bitmex.com';
$port = 443;
$client = new \Swoole\Coroutine\Http\Client($domain, $port, true);
$client->set([
'http_proxy_host' => '127.0.0.1',
'http_proxy_port' => '6666',
]);
$ret = $client->upgrade('/runtime');
var_dump($ret);
var_dump($client->errCode);
var_dump(socket_strerror($client->errCode));
if($ret)
{
while (true)
{
$body = $client->recv();
var_dump($body);
Coroutine::sleep(0.1);
}
}
});
} |
运行结果:
bool(false)
int(1)
string(23) "Operation not permitted"