From 27d5d132d8c06336bc96cdb91578c459576e5527 Mon Sep 17 00:00:00 2001 From: ywisax Date: Tue, 4 Jun 2024 00:39:30 +0800 Subject: [PATCH] Allow set `$raw` in send method when pipe connection --- Connection/TcpConnection.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Connection/TcpConnection.php b/Connection/TcpConnection.php index 740f01d61..370018d09 100644 --- a/Connection/TcpConnection.php +++ b/Connection/TcpConnection.php @@ -777,13 +777,14 @@ public function doSslHandshake($socket){ * This method pulls all the data out of a readable stream, and writes it to the supplied destination. * * @param self $dest + * @param bool $raw * @return void */ - public function pipe(self $dest) + public function pipe(self $dest, $raw = false) { $source = $this; - $this->onMessage = function ($source, $data) use ($dest) { - $dest->send($data); + $this->onMessage = function ($source, $data) use ($dest, $raw) { + $dest->send($data, $raw); }; $this->onClose = function ($source) use ($dest) { $dest->close();