index.rst (2759B)
1 ============================= 2 Inspecting server-sent events 3 ============================= 4 5 `Server-sent events <https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events>`_ allow for an inversion of the traditional client-initiated web request model, with a server sending new data to a web page at any time by pushing messages. You can inspect server-sent events and their message contents using the :doc:`Network Monitor <../index>`. This article shows you how. 6 7 Inspecting the SSE network activity 8 *********************************** 9 10 When you are viewing a document that is receiving server-sent events, you can go to the Network Monitor, select the file that is sending the server-sent events, and view the received messages in the *Response* tab on the right-hand panel. 11 12 .. image:: basic-sse-message-view.png 13 :class: border 14 15 16 At the top of the panel there is a trash can icon, which allows you to trash the messages sent so far, and a filter field in which you can enter a text string to filter the displayed messages by. 17 18 19 Viewing the message contents 20 **************************** 21 22 Select one of the messages listed in the *Response* tab, and you'll see the message contents displayed at the bottom of that same tab. 23 24 .. image:: see-message-detail-view.png 25 :class: border 26 27 In the above example, you can see that JSON and raw data representations of the content are shown. For a plain text message, you'd just see a raw data section. 28 29 The supported data formats are as follows: 30 31 - Mercure protocol 32 - JSON 33 34 35 Customizing the displayed columns 36 ********************************* 37 38 For each message, you'll see *Data* and Time columns by default, but you can right-click on the table header to bring up a context menu in which you can toggle columns on and off, and reset it back to its original state. 39 40 .. image:: customize-columns.png 41 :class: border 42 43 The available columns are as follows: 44 45 - *Data*: A summary of the contained message data. 46 - *Size*: The size of the message. 47 - *Time*: A timestamp representing when the message was sent. 48 - *Event Name*: The name of the event type that resulted in the message being sent (e.g. ```message``` or ```ping```). 49 - *Last Event ID*: The ID of the last event that was fired. 50 - *Retry*: The interval after which failed message will be resent. 51 52 53 Network Monitor features 54 ************************ 55 56 The following articles cover different aspects of using the network monitor: 57 58 - :doc:`Toolbar <../toolbar/index>` 59 - :doc:`Network request list <../request_list/index>` 60 - :doc:`Network request details <../request_details/index>` 61 - :doc:`Network traffic recording <../performance_analysis/index>` 62 - :doc:`Throttling <../throttling/index>` 63 - :doc:`Inspecting web sockets <../inspecting_web_sockets/index>`