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...@googlegroups.com
>> <mailto:
django-users%2Bunsu...@googlegroups.com>.
>> <mailto:
django...@googlegroups.com>.
>
https://groups.google.com/d/msgid/django-users/52C0D381.3060100%40gmail.com.