Category : sockets

I have created a laravel event: <?php namespace AppEvents; use IlluminateBroadcastingChannel; use IlluminateBroadcastingInteractsWithSockets; use IlluminateBroadcastingPresenceChannel; use IlluminateBroadcastingPrivateChannel; use IlluminateContractsBroadcastingShouldBroadcastNow; use IlluminateFoundationEventsDispatchable; use IlluminateQueueSerializesModels; class AssetsInfo implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels; public $actionId; public $actionData; public function __construct($actionId, $actionData) { $this->actionId = $actionId; $this->actionData = $actionData; } public function broadcastOn() { return new Channel(‘sahmshenas-channel’); ..

Read more

I want to send data to ratchet via class in php to send it to client send data through JavaScript var conn = new WebSocket(‘ws://localhost:6001/’); conn.onmessage = function(e) { console.log(e.data); }; conn.onopen = function(e) { conn.send(‘Hi’); }; But I want to send data to ratchet via php for send notification How do I do this? ..

Read more

i need to make socket connection without ssl but every time it try to connect to wss not ws i’m using laravel swoole ‘pusher’ => [ ‘driver’ => ‘pusher’, ‘key’ => env(‘PUSHER_APP_KEY’), ‘secret’ => env(‘PUSHER_APP_SECRET’), ‘app_id’ => env(‘PUSHER_APP_ID’), ‘encrypted’ => false, //# for HTTP ‘options’ => [ ‘cluster’ => env(‘PUSHER_APP_CLUSTER’), ‘host’ => ‘127.0.0.1’, ‘port’ => ..

Read more

I want to use reactphp socket for push notifications in laravel but I do not know what to do? route: Route::get(‘/test’, function () { event(new testEvent($test)); }); event: public $test; public function __construct($test) { $this->test = $test; } public function broadcastOn() { return new PrivateChannel(‘test.’ . $this->test->id); } channel: Broadcast::channel(‘test.{test}’, function ($user, $id) { return ..

Read more

I want to create multi events in socket io with redis this is my code *** var redisClient = redis.createClient(6379, "127.0.0.1"); redisClient.on(‘connect’, function() { console.log(‘we are connected with redis server’) }); redisClient.subscribe(‘message’,’call’,’status’); redisClient.on("message", function(channel, message) { var data = JSON.parse(message); console.log("new message in queue " + "channel : " + channel + " reciever: " ..

Read more

im trying to connect my backend laravel to my frontend nuxt, what im trying to do here is, i want to send response to client when server execute/process some url/api. i want my client get response after server execute this url /api/test-broadcast-notification. here’s the route. Route::get(‘test-broadcast-notification’, function() { $user = AppUser::find(1); event(new AppEventsPrivateMessage($user)); }); my ..

Read more

My real time notifications are working properly, Im try to send message but getting error. chat system and video chat is not working that is build in socket io Laravel. Here is all code of my chat system and also error image Here is my app Username: cus Password: 123456 Send message code $(document).on(‘submit’,’.chat_form’,function(e){ e.preventDefault(); ..

Read more

I am following the tutorial given in https://medium.com/@dennissmink/laravel-echo-server-how-to-24d5778ece8b . I installed laravel-echo-server, redis, socket.io, laravel-echo. This is the configuration of laravel-echo-server init { “authHost”: “http://localhost”, “authEndpoint”: “/broadcasting/auth”, “clients”: [], “database”: “redis”, “databaseConfig”: { “redis”: {}, “sqlite”: { “databasePath”: “/database/laravel-echo-server.sqlite” } }, “devMode”: true, “host”: null, “port”: “6001”, “protocol”: “http”, “socketio”: {}, “secureOptions”: 67108864, “sslCertPath”: “”, ..

Read more

I successfully developed the record-keeping system with some CRUD functionality using laravel. Now, the client changes his requirement and says he need a system that should only be accessible from his office’s specific computer. After research, I’ve found that PHP can’t access the mac address of the client because of server-side scripting language. The alternative ..

Read more