diff options
author | marvin-borner@live.com | 2018-04-16 21:09:05 +0200 |
---|---|---|
committer | marvin-borner@live.com | 2018-04-16 21:09:05 +0200 |
commit | cf14306c2b3f82a81f8d56669a71633b4d4b5fce (patch) | |
tree | 86700651aa180026e89a66064b0364b1e4346f3f /assets/php/vendor/react/socket/examples/12-https-client.php | |
parent | 619b01b3615458c4ed78bfaeabb6b1a47cc8ad8b (diff) |
Main merge to user management system - files are now at /main/public/
Diffstat (limited to 'assets/php/vendor/react/socket/examples/12-https-client.php')
-rwxr-xr-x | assets/php/vendor/react/socket/examples/12-https-client.php | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/assets/php/vendor/react/socket/examples/12-https-client.php b/assets/php/vendor/react/socket/examples/12-https-client.php deleted file mode 100755 index 6e3f279..0000000 --- a/assets/php/vendor/react/socket/examples/12-https-client.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -// Simple secure HTTPS client example (for illustration purposes only). -// This shows how a secure TLS connection is established to then send an -// application level protocol message (HTTP). -// Real applications should use react/http-client instead -// -// This simple example only accepts an optional host parameter to send the -// request to. See also example #22 for proper URI parsing. -// -// $ php examples/12-https-client.php -// $ php examples/12-https-client.php reactphp.org - -use React\EventLoop\Factory; -use React\Socket\Connector; -use React\Socket\ConnectionInterface; - -$host = isset($argv[1]) ? $argv[1] : 'www.google.com'; - -require __DIR__ . '/../vendor/autoload.php'; - -$loop = Factory::create(); -$connector = new Connector($loop); - -$connector->connect('tls://' . $host . ':443')->then(function (ConnectionInterface $connection) use ($host) { - $connection->on('data', function ($data) { - echo $data; - }); - $connection->on('close', function () { - echo '[CLOSED]' . PHP_EOL; - }); - - $connection->write("GET / HTTP/1.0\r\nHost: $host\r\n\r\n"); -}, 'printf'); - -$loop->run(); |