Comments (9)
You can override the driver with a custom one that accepts the additional client_options added.
Also verify needs to be false.
In your BroadcastServiceProvider:
public function boot(BroadcastManager $broadcastManager)
{
Broadcast::routes();
$broadcastManager->extend('pusher', function($app, $config) {
$pusher = new Pusher(
$config['key'], $config['secret'],
$config['app_id'], $config['options'] ?? [],
new \GuzzleHttp\Client($config['client_options']) ?? []
);
if ($config['log'] ?? false) {
$pusher->setLogger($this->app->make(LoggerInterface::class));
}
return new PusherBroadcaster($pusher);
});
require base_path('routes/channels.php');
}
from soketi.
@francoism90 I think that having Pusher 6.x+ and passing a client instance when creating the Pusher\Pusher
instance is much better than extending the entire class :)
- Add this to broadcasting:
'options' => [
// ...
],
'client_options' => [
'verify' =>true, // to disable TLS checks
],
- Extend the
Illuminate\Broadcasting\BroadcastManager
to create Pusher with client options:
namespace App;
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
use Illuminate\Broadcasting\BroadcastManager as BaseBroadcastManager;
use Psr\Log\LoggerInterface;
use Pusher\Pusher;
class TlsSupportingBroadcastManager extends BaseBroadcastManager
{
protected function createPusherDriver(array $config)
{
$pusher = new Pusher(
$config['key'], $config['secret'],
$config['app_id'], $config['options'] ?? [],
new \GuzzleHttp\Client($config['client_options']) ?? []
);
if ($config['log'] ?? false) {
$pusher->setLogger($this->app->make(LoggerInterface::class));
}
return new PusherBroadcaster($pusher);
}
}
- Re-instantiate the
BroadcastManager
at runtime:
namespace App\Providers;
use App\TlsSupportingBroadcastManager;
class BroadcastingServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->singleton(BroadcastManager::class, function ($app) {
return new TlsSupportingBroadcastManager($app);
});
}
}
from soketi.
@francoism90 It seems like it got merged in 9.x. Until then, I hope the workaround works.
from soketi.
@rennokki Great news! I'll wait for Laravel 9 and use Pusher v5 for now. :)
from soketi.
Yes it works on laravel 8 with verify set to false, I did state that maybe I should have highlighted that. I did try various approaches to overriding the singleton with little success. This works by providing the broadcast manager a custom driver and because the broadcast manager looks for custom driver first, you can keep the same driver name.
from soketi.
Seems downgrading is the only way? :(
from soketi.
@rennokki Thanks for your workaround and details how to use it!
I'll wait if proposed PR is going to be merged, otherwise I'll implement this solution. :)
from soketi.
@w00key This seems to work (local) on Laravel 8 using verify' => false
. :)
from soketi.
Refer beyondcode/laravel-websockets#879 (comment)
from soketi.
Related Issues (20)
- [BUG] Metrics - process uncaughtException HOT 1
- Cloudflare Token is not valid. HOT 5
- Is there any way to use server sent events (sse) with soketi? HOT 2
- [REQUEST]: App ID & Secret HOT 4
- [BUG] Soketi Does Not Connect HOT 1
- [BUG] Soketi not starting on nodejs major v20 HOT 10
- [BUG] Duplicate messages being sent to client HOT 2
- [REQUEST] Consider using DragonflyDB and/or KeyDB instead of Redis HOT 2
- [REQUEST] Force Dockerfile.debian to VERSION 16 HOT 2
- EVENT_MAX_SIZE_IN_KB is not working in docker soketi HOT 1
- [BUG] queue redis driver HOT 2
- [REQUEST] Add Support for json export of metrics and usage HOT 1
- [BUG] I can't seem to install soketi in pnpm v8.12 and node v20 HOT 1
- Can't deploy it with ssl and nginx HOT 3
- soketi can not working in Docker ? HOT 5
- https://dash.soketi.app/register seems to be down HOT 7
- [BUG] Fix broken cloudflare links on Create New Credentials HOT 1
- [REQUEST] Add curl or wget to containers for Docker healthchecks HOT 1
- [REQUEST] Laravel echo now requires a "cluster" option for socketi client HOT 4
- https://dash.soketi.app/ seems to be down. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soketi.