N
N
nepster-web2013-12-08 17:52:32
Yii
nepster-web, 2013-12-08 17:52:32

How to define an SSE request?

The task is such, you need to track which page the user visits.
I am using Yii and

protected function beforeAction()
    {
          // вызов функции, которая в базу пишет url 
    }

So, in parallel, I use a library to work with SSE, and for example, when I visit a page, the helpdesk/ask entry gets into the database , but after 5 seconds, when the event fires, this field will get a link from which the server responds.
Can you please tell me how to ignore the sse response?
I tried something like this:
if( !Yii::app()->request->isAjaxRequest )
           {
             libUsers::load()->where_the_user();
           }

All the same does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2013-12-08
@fornit1917

SSE requests probably have some special http header by which they can be identified. Try to look at the request headers more closely in firebug, maybe you will see some kind of distinguishing feature.

_
_ _, 2013-12-08
@AMar4enko

How about google?
habrahabr.ru/post/120429
Protocol Server-Sent Events
The client sends a request to the server, the server sends the following header in response:
Content-Type: text/event-stream
Filter out this header. Ideally somewhere on a proxy server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question