How to receive new messages through the REST API ofchat?

Hi. I am new to XMPP and I am developing a mobile chat application using the plugin created by Dele_Olajider:

ofchat

But I do not know how to capture the new messages that are arriving, since “http: // MY_SERVER: 7070 / rest / api / restapi / v1 / chat / {streamid} / messages” only delivers old messages.
It seems that I should use “http: // MY_SERVER: 7070 / rest / api / event / source” but I do not understand how it works.
Can it be done with websocket too?
Thanks, any help is welcome, this has me stressed :frowning: