Access channel from IO scope
See original GitHub issueI’m trying to access a channel id from the io
scope to send a message (right before they get kicked haha!):
io.channel[player.id].emit('chat message', 'You have been kicked for cheating!');
And player.id is just the channel.id. But the above is not working. Is there a way to access a specific channel by id from the io
scope?
This does work:
io.channel[player.id].close();
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Consumers — Channels 4.0.0 documentation
Consumers receive the connection's scope when they are called, which contains a lot of the information you'd find on the request object in...
Read more >What scope is required to access a YouTube channel title ...
I am currently using the scopes with offline access: https://www.googleapis.com/auth/youtube.force-ssl; https://www.googleapis.com/auth ...
Read more >Crash Course Kotlin Flows, Channels and Shared/State Flows
A channel is like a queue, it can receive data and it can be then consumed by another component.
Read more >Use Kotlin coroutines with lifecycle-aware components
Kotlin coroutines provide an API that enables you to write asynchronous code. With Kotlin coroutines, you can define a CoroutineScope , which ...
Read more >Connection device rules — resource groups Copy ... - IBM
This device address is referred to as the connection device. That is, the device to which the channel or initiator connects to issue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, this is not possible yet.
But I guess I could forward the http request to the authentication function? Then you could get the ip using
request.connection.remoteAddress
orrequest.headers['x-forwarded-for']
(if behind a proxy).Or you could store a unique key in localStorage and authenticate the user with it using the new authorization process.
Btw, thanks a lot for your sponsorship! It really helps a lot 😃
Will publish it soon to npm.