How to receive http data stream in node red?

I have a device that generates events. These events can be accessed in the browser by entering the IP address of the reader and appending "/datastream" to the URL. In the browser, I see individual JSON files coming in. Now, I would like to receive this information in Node-RED. I have already tried to do this using a GET request, but without success. I couldn't find any information online on how to get this data stream (including new incoming events) into Node-RED.

Can someone please help me get started?

Do you mean the web page is "streaming" in the sense that you can see it "live" as it happens, or you have to refresh the page to see the latest?

Live as it happens, i don't need to refresh the page.

Ok, this may be using a concept called SSE (Server Sent Events)

Try this node by our own @BartButenaers

Its specially designed for SSE

thanks Marcus, i did not know this was a server sent event. unfortunately i can't make the stream vissible in Node red, i get a time out after a couple of seconds.

It was just a guess, it may not be SSE...
what does the headers show in browser network log?

Might help if you shared the device type so we could look up the API.

Ok yes it's a Impinj r700 RFID reader: Impinj IoT Device Interface | Impinj Developers

Being an RFID reader - it would make sense that it's a streaming API.
does it not have URL callback instead? or maybe a Web Socket transport?

I don't think the HTTP Request Node allows for sending data as its received?

case and point..

@Steve-Mcl - maybe one for V4?

@werneroostendorp if nothing can be found in the Node library, it may still be possible, by using a HTTP library, directly inside a function node

It could well be possible using a TCP Request Node as well, to construct a HTTP request payload, and set to never close.

What about using the MQTT capabilities it boasts?

2 Likes

Missed that - Nice!

@werneroostendorp - this is by far, your easiyest solution.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.