Server Sent Event for Specific Client in YAWS server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Server Sent Event for Specific Client in YAWS server

Mohammed mazhar uddin
Hello all,

         Is there any way to make my SSE(sever sent events) handler send
the message to a specific client and to a specific page,

             I have gone through the SSE and understood that the server
is sending the events to all the connected clients and the event is
accessible in every page, and we are just handling the event in
javascript. in short all the clients are receiving the events sent by
the server.

                 Is there any way to overcome this? is there any better
way to work with SSE? my requirement here is to query some external node
and send the data to the client and i don't want all the clients to be
receiving that data and also i want that data to be received only when
the client is accessing a specific page.

Your earliest response in this regard would be highly appreciated.

Thanks in advance.

With Regards,

Mazhar.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Server Sent Event for Specific Client in YAWS server

Steve Vinoski-2
Note that you might be better off sending Yaws questions to the Yaws mailing list (https://sourceforge.net/projects/erlyaws/lists/erlyaws-list).

On Thu, Dec 14, 2017 at 6:26 AM, Mazhar <[hidden email]> wrote:
Hello all,

        Is there any way to make my SSE(sever sent events) handler send the message to a specific client and to a specific page,

            I have gone through the SSE and understood that the server is sending the events to all the connected clients and the event is accessible in every page, and we are just handling the event in javascript. in short all the clients are receiving the events sent by the server.

I'm not sure I understand what you mean by the event being sent to all connected clients. Events are sent on specific client connections. Perhaps you're saying that your server-side code for a particular resource is going into SSE mode regardless of how a client accesses that resource?

                Is there any way to overcome this? is there any better way to work with SSE? my requirement here is to query some external node and send the data to the client and i don't want all the clients to be receiving that data and also i want that data to be received only when the client is accessing a specific page.

Your earliest response in this regard would be highly appreciated.

What you're asking for is entirely possible. I'd recommend either emailing the Yaws mailing list or just emailing me directly to get more help. I'd like to see the code you're currently using so I can get a better idea of what directions to give you.

--steve

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions