Sunday, December 29, 2013

Re: Server Sent Event to a specific user

On 30/12/2013 12:59pm, Thai Tran wrote:
> Yes, that was what I thought. But letting the user subscribe to a
> channel without any validation / authorization is a bit scary. That is
> why I wanna push the message based on the user session, not through a
> user name or strings like that

If timing requirements permit, you could let the client side request
messages frequently enough to satisfy users. I think that would be
nicely low-tech and somewhat tune-able.

>
> On 12/30/2013 2:03 AM, Nevio Vesic wrote:
>> Well You can always send custom events for some specific channel. Example:
>>
>> socket.on("global_event",function(channel,data){});
>> socket.on("user_XYZ",function(channel,data){});
>>
>> emit_to_channel('some_room', 'gobal_event', 'hello')
>> emit_to_channel('some_room', 'user_XYZ', 'hello XYZ')
>>
>> I understand this is not the most secure way but you can ensure
>> additional encryption like hashing on every request or shit like that
>> or even have every user connects to its own "secured" channel.
>>
>> Hope this helps.
>>
>>
>> Hi,
>>
>> I am working on a message sending/reading app atm. Is there any
>> way to push a message to a particular user session by using Redis
>> and SSE ? I am using the tutorial at
>> https://github.com/fcurella/django-push-demo and it works great
>> with the current setup (which means I can send the whole bunks of
>> new messages to all users but this is not what I wish for,
>> obviously). When a user A composes a message and send to user B,
>> how can I just "push" that new message to that particular user B ?
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to django-users+unsubscribe@googlegroups.com
>> <mailto:django-users%2Bunsubscribe@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAM3VocpM%2Bn1Xw0mhMf3iWbQD%2BjZ%2BGini5v5XjPXYipXjnLTJzg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscribe@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAD1DFf1T0nTLPV2fO5Y4RDgmZ%3DWQziFCeORearNi1ioX43Zg5w%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/52C0D381.3060100%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52C0DA03.5060604%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment