Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dizews committed Oct 26, 2020
1 parent c052b83 commit 438d703
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions Pusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ public function flush()
*/
public function listen($channels, $callback = null)
{
$endpoint = $this->makeEndpoint(array_merge($this->serverOptions, $this->listenServerOptions));
if (substr($endpoint, -1) != '/') {
$endpoint .= '/';
}
$endpoint .= implode($this->channelSplitter, (array)$channels);
$endpoint = $this->getListenerHost($channels);

$response = $this->client->get($endpoint, [
'stream' => true
Expand All @@ -129,6 +125,17 @@ public function listen($channels, $callback = null)
}
}

public function getListenerHost($channels)
{
$endpoint = $this->makeEndpoint(array_merge($this->serverOptions, $this->listenServerOptions));
if (substr($endpoint, -1) != '/') {
$endpoint .= '/';
}
$endpoint .= implode($this->channelSplitter, (array)$channels);

return $endpoint;
}

/**
*
* @param $serverOptions array of server options
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": ">=7.2",
"yiisoft/yii2": "*",
"yiisoft/yii2": "^2.0",
"guzzlehttp/guzzle": "^6.2"
},
"autoload": {
Expand Down

0 comments on commit 438d703

Please sign in to comment.