Hi there,
after googling for jsonp, jQuery and JSON-streaming I finally found Portal.
At the moment, thanks for the free time cos of holidays, I'm trying to stream some JSON data via a persistend web-socket or HTTP connection.
I got a server running which is able to provide a permanent HTTP connection and can stream some JSON data. Now I'm trying to get these data-chunks parsed with Portal.
My HTML-code somehow looks like this:
Viewing this page in the browser results in an additional GET request from Portal:
GET /rpc?when=open&transport=ws&heartbeat=false&lastEventId=0&id=df6354ae-b6f4-46a6-9584-e60db1744c7a&_=1387965636267 HTTP/1.1
How should I handle this request? At the moment I'm sending
{"data": 0, "type": "message", "id": "df6354ae-b6f4-46a6-9584-e60db1744c7a", "reply": false}
But my browser calls GET multiple time which shouldn't be the case.
Also the transport is "ws", is this correct?
Is there a state-machine which moves from "open" to something else?
Thanks a lot for your hints!
Regards and some nice Holidays!