From d225efb9ca4c3972cebf3c68684d8a0b90cce75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 26 May 2017 15:00:56 +0200 Subject: [PATCH] Fix reporting listening addresses in examples --- examples/01-hello-world.php | 2 +- examples/02-count-visitors.php | 2 +- examples/03-client-ip.php | 2 +- examples/04-query-parameter.php | 2 +- examples/05-cookie-handling.php | 2 +- examples/06-sleep.php | 2 +- examples/07-error-handling.php | 2 +- examples/08-stream-response.php | 2 +- examples/09-stream-request.php | 2 +- examples/11-hello-world-https.php | 2 +- examples/21-http-proxy.php | 2 +- examples/22-connect-proxy.php | 2 +- examples/31-upgrade-echo.php | 2 +- examples/32-upgrade-chat.php | 2 +- examples/99-benchmark-download.php | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/01-hello-world.php b/examples/01-hello-world.php index cf047944..4b34f5af 100644 --- a/examples/01-hello-world.php +++ b/examples/01-hello-world.php @@ -20,6 +20,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/02-count-visitors.php b/examples/02-count-visitors.php index 9f69f797..a2788510 100644 --- a/examples/02-count-visitors.php +++ b/examples/02-count-visitors.php @@ -19,6 +19,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/03-client-ip.php b/examples/03-client-ip.php index 31b7ad32..ee6d4f90 100644 --- a/examples/03-client-ip.php +++ b/examples/03-client-ip.php @@ -20,6 +20,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/04-query-parameter.php b/examples/04-query-parameter.php index 15f6c49a..ab64aef0 100644 --- a/examples/04-query-parameter.php +++ b/examples/04-query-parameter.php @@ -27,6 +27,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/05-cookie-handling.php b/examples/05-cookie-handling.php index 67e008bb..8b453a6f 100644 --- a/examples/05-cookie-handling.php +++ b/examples/05-cookie-handling.php @@ -33,6 +33,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/06-sleep.php b/examples/06-sleep.php index 9fb75542..f04b1758 100644 --- a/examples/06-sleep.php +++ b/examples/06-sleep.php @@ -24,6 +24,6 @@ }); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/07-error-handling.php b/examples/07-error-handling.php index 00ed0cfa..265a1e27 100644 --- a/examples/07-error-handling.php +++ b/examples/07-error-handling.php @@ -30,6 +30,6 @@ }); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/08-stream-response.php b/examples/08-stream-response.php index e563be38..a3d578d4 100644 --- a/examples/08-stream-response.php +++ b/examples/08-stream-response.php @@ -34,6 +34,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/09-stream-request.php b/examples/09-stream-request.php index fabb5bb7..356a6f22 100644 --- a/examples/09-stream-request.php +++ b/examples/09-stream-request.php @@ -39,6 +39,6 @@ }); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/11-hello-world-https.php b/examples/11-hello-world-https.php index de958007..bf1b6d34 100644 --- a/examples/11-hello-world-https.php +++ b/examples/11-hello-world-https.php @@ -24,6 +24,6 @@ //$socket->on('error', 'printf'); -echo 'Listening on https://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tls:', 'https:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/21-http-proxy.php b/examples/21-http-proxy.php index 720f51fe..1285f5ed 100644 --- a/examples/21-http-proxy.php +++ b/examples/21-http-proxy.php @@ -40,6 +40,6 @@ //$server->on('error', 'printf'); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/22-connect-proxy.php b/examples/22-connect-proxy.php index 7e7acd2c..5b5af3ed 100644 --- a/examples/22-connect-proxy.php +++ b/examples/22-connect-proxy.php @@ -44,6 +44,6 @@ function ($e) { //$server->on('error', 'printf'); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/31-upgrade-echo.php b/examples/31-upgrade-echo.php index b28e8344..9e7d61d9 100644 --- a/examples/31-upgrade-echo.php +++ b/examples/31-upgrade-echo.php @@ -53,6 +53,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/32-upgrade-chat.php b/examples/32-upgrade-chat.php index eb74b674..d3cae956 100644 --- a/examples/32-upgrade-chat.php +++ b/examples/32-upgrade-chat.php @@ -80,6 +80,6 @@ ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run(); diff --git a/examples/99-benchmark-download.php b/examples/99-benchmark-download.php index 0be294b1..b34a6b89 100644 --- a/examples/99-benchmark-download.php +++ b/examples/99-benchmark-download.php @@ -114,6 +114,6 @@ public function getSize() ); }); -echo 'Listening on http://' . $socket->getAddress() . PHP_EOL; +echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; $loop->run();