tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 510 forks source link

how to specify it is Presence Channels using http #585

Open NatBLida68 opened 2 years ago

NatBLida68 commented 2 years ago

running echo server in my local host https://127.0.0.1:6001/apps/APP_ID/channels/CHANEL_NAME/users?auth_key=AUTH_KEY returns User list is only possible for Presence Channels

`$client = new Client(['verify' => false]); // deactivated ssl verification $body = ["channel"=>CHANEL_NAME,"name"=>event_Name,"data"=>[//my data];

$client->request(
    'POST',
    'https://'.env('SOCKET_HOST').'/apps/'.env('SOCKET_APP_ID').'/events?auth_key='.env('SOCKET_KEY'),
    [
        'body' => json_encode($body),
    ]
);`

this is how i broadcast an event and i use data in js (listening side) to restrict users from listening i use echo server and socket-io-client only Echo.channel(ChannelName) .listen('.event_Name', e => { alert(e.message); //from my data }) NB:and this works , but i want to see the users joined in channel and i don't know how to specify it is Presence Channels in this way i know i can do with laravel broadcast but if i can do this within this code