Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

how to specify it is Presence Channels using http #585

Open
NatBLida68 opened this issue Nov 27, 2021 · 0 comments
Open

how to specify it is Presence Channels using http #585

NatBLida68 opened this issue Nov 27, 2021 · 0 comments

Comments

@NatBLida68
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant