# \[ANNOUNCE\] node-red-contrib-sse-client

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025>\
**Category:** Share Your Nodes\
**Created:** [23 June 2018 20:03 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025 "2018-06-23T20:03:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [23 June 2018 20:03 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/1 "2018-06-23T20:03:47Z")

</div>

Hi folks,

A couple of weeks ago there was a [topic](https://discourse.nodered.org/t/http-response-not-receiving-data/521) on this forum about listening to an SSE stream (Server Sent Events). Seemed that there was no real SSE client available in Node-Red, so I decided to create [node-red-contrib-sse-client](https://github.com/bartbutenaers/node-red-contrib-sse-client).

Will publish it to NPM in a couple of days. Until then it can be installed directly from my Github account:  
`npm install bartbutenaers/node-red-contrib-sse-client`

All 'constructive' feedback is more than welcome !

P.S. I have a minor CSS issue. My config screen contains two tables ('events' and 'http headers'), both having the same minimum heigth:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/11009818d1f6d1b595ca1e341063fe97fba9b913.png)

I hoped that both tables would get the _ **same height** _, however the screenshot shows that the last table has more heigth. Does somebody know how this can be accomplished ?

Kind regards,  
Bart Butenaers

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 June 2018 22:24 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/2 "2018-06-23T22:24:20Z")

</div>

@BartButenaers - I tried instalng this in the NR running on my Mac and it does not show up in the sidebar.

Is there something I’m missing?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 June 2018 06:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/3 "2018-06-24T06:22:29Z")

</div>

Tiny comments. The label Url should probably be URL to be consistent. And the prompt Enter URL would be better with a small example. I don’t know SSE so is the URL local? Have a standard pattern ? Have a default?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [24 June 2018 08:31 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/4 "2018-06-24T08:31:23Z")

</div>

Hi Paul (@zenofmud), I have uninstalled it on my Raspberry and installed it again but no problems here ...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/5c77f0f5da079380de7c65f69a2d5b1e61cc4a8e.png)

When you install a node directly from Github, you should refresh your browser window. Otherwise the installed node doesn't appear in the sidebar. Could that be the problem ??

Hi Dave (@dceejay), the code on Github is updated with your feedback (uppercase label, placeholder "_http://_", and same validation like in the httprequest node):

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/ddd7ca53bc09e7b5145a4cdde0c46b02c98c729d.png)

P.S. the URL can be any SSE server (local or not), like e.g. the SSE demo stream on my readme page. So I cannot add a default URL.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 June 2018 08:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/5 "2018-06-24T08:54:59Z")

</div>

Hi. Didn’t mean you to add it as the (active) default, but you could make the prompt say. " URL e.g. [http://your.server.com](http://your.server.com)"

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 June 2018 08:55 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/6 "2018-06-24T08:55:27Z")

</div>

Ok, I uninstalled and installed it and now I see it - it could be that I was looking in the wrong place....

The layout is even for me on the mac in Safari, Chrome and FireFox:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/eb011df8f9a337eb15842673310c6ecf706de911.png)

(Bear with me since this is the first time I've heard of SSE) Why the two options when you press '+' in the HTTP headers?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/0ccef9b0c8bbe32ea4211be6f37641af260c5635.png)  
looking at the code is the first the header name and the second the header value? It is not clear to me. Maybe putting a default in both and expanding the explanation would be useful or if the header name is a set possibility, why not make that a pulldown list with all the possibilities.

Just some observations

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [24 June 2018 09:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/7 "2018-06-24T09:18:10Z")

</div>

Hi guys,

I must admit that the new version on Github has become a bit more self-explaining:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/69182ad56c4b8d90a292664b6ef7134a34bdf6d5.png)

@zenofmud: the [list](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) of possible http header fields is rather large, so not really useful to show them in a dropdown. Instead I have added now a link in the node's info help:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/f25fed8fa37206ae5b5ce0760892256f9c89243b.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 June 2018 18:40 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/8 "2018-06-24T18:40:26Z")

</div>

I looks much nicer now!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [7 July 2018 20:19 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/9 "2018-07-07T20:19:31Z")

</div>

Hi folks,

I have published this morning version **0.0.1** to NPM. You can find it [here](https://www.npmjs.com/package/node-red-contrib-sse-client) on NPM.

For some reason you cannot find it by searching on NPM, and it is also not visible on [flows.nodered.org](http://flows.nodered.org). Hopefully this is related to the [issue](https://github.com/npm/registry/issues/366) that Nick has reported on NPM, and hopefully it will be fixed soon ...

Bart

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [19 August 2018 09:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/10 "2018-08-19T09:52:14Z")

</div>

FYI : Just released version **0.1.0** which allows the **_URL_** and **_Http headers_** to be set in the input message (when not specified in the config screen).

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [19 August 2018 10:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/11 "2018-08-19T10:37:14Z")

</div>

Looks interesting - what is SSE typically used for ? Are there some useful publicSSE servers out there?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [19 August 2018 12:12 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/12 "2018-08-19T12:12:11Z")

</div>

I haven't really used it myself, just developed that node to help some poor souls on this forum...

It is used for clients that want to be notified automatically by a server, for changes that occur on that server. So the clients don't need to poll every X seconds, to ask the server for new changes.

For example your Node-RED editor shows all flow changes of the server (node status updates...). The main difference is that the flow editor uses websockets to implement this. Websockets is a bit similar to SSE, but there are some major [differences](https://streamdata.io/blog/push-sse-vs-websockets/).

---

<div class="post-metadata">

**Author:** ![huntc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/huntc/32/4448_2.png) [@huntc](https://discourse.nodered.org/u/huntc)\
**Post date:** [12 December 2018 04:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/13 "2018-12-12T04:18:21Z")

</div>

SSE is very useful and under utilised in my opinion. In essence, events are pushed to the client JavaScript. In particular, your JavaScript doesn't have to perform any connection management as the browser takes care of this for you. This, along with a little more structure than WebSockets, is the major selling point.

BTW: Thanks for providing the node! I noticed a small issue where I was unable to use a mustache template declaration in the URL. I got around the issue by constructing the msg.url as an input, but I thought you'd like to know.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 December 2018 06:11 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/14 "2018-12-12T06:11:14Z")

</div>

Hi Christopher,

Thanks for yor feedback! Indeed I don't support Mustache yet. Will add it when I have time. Have to write it down somewhere, otherwise I'm going to forget it 😉

Bart

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 December 2018 19:53 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/15 "2018-12-12T19:53:27Z")

</div>

Christopher,

I have published version **0.2.0** on NPM, which allows the URL to contain the Mustache syntax. Information has been added both in the Info panel and on the Readme page. Please let me know if you have any issues with it...

Have fun!  
Bart

---

<div class="post-metadata">

**Author:** ![huntc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/huntc/32/4448_2.png) [@huntc](https://discourse.nodered.org/u/huntc)\
**Post date:** [12 December 2018 20:08 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/16 "2018-12-12T20:08:47Z")

</div>

Wow, thank you so much!

---

<div class="post-metadata">

**Author:** ![Eelco](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@Eelco](https://discourse.nodered.org/u/Eelco)\
**Post date:** [12 May 2020 11:25 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/17 "2020-05-12T11:25:31Z")

</div>

Hi Bart, I notice it is two years ago you took up my challenge and only now I come back to give it a try. I have imported the demo flow on your (excellent!!) explanation of how to use sse-client.

Now the bad thing is that the node does not connect (red status) (Node-Red on Azure Ubuntu 18.04 VM, as good as new). I did try the curl command you also provided on my Windows laptop, which demonstrates the demo is pushing events. So error is in my Node-red install. Hmmm...

I suspect that the s in https breaks my experience. Would you have straightforward way to fix? Do I need to modify a setting?

Thanks Eelco

---

<div class="post-metadata">

**Author:** ![Eelco](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@Eelco](https://discourse.nodered.org/u/Eelco)\
**Post date:** [12 May 2020 14:57 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/18 "2020-05-12T14:57:29Z")

</div>

Just as a thought.... perhaps you can do me the favor of porting logic from node-red-contrib-https into sse client. That is by far more easy than to configure a TLS setting (for the user, not for you, I acknowledge)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 May 2020 16:58 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/19 "2020-05-12T16:58:56Z")

</div>

> [@Eelco](#):
>
> I suspect that the s in https breaks my experience.

It is not clear to my what you mean with this.  
The demo on my readme page uses a "_https_..." url:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b30eac442db6a23eaa5b27e8a7a6d79218708cb1.png)

I have tried it and the demo is still working on the latest Node-RED.  
Is it this demo that doesn't work in your case?  
And why do you think that the "s" is breaking it? Can I assume you have seen some ssl related errors in your log?

> [@Eelco](#):
>
> porting logic from node-red-contrib-https into sse client.

Which part of that node are you referring to? With such little information, it is rather hard to understand what you mean.

> [@Eelco](#):
>
> That is by far more easy than to configure a TLS setting

Am I correct that you mean credentials (username/password), or what do you mean with "TLS setting"? I have never used that node, so just guessing ...

---

<div class="post-metadata">

**Author:** ![Eelco](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@Eelco](https://discourse.nodered.org/u/Eelco)\
**Post date:** [12 May 2020 20:04 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/20 "2020-05-12T20:04:15Z")

</div>

Hi Bart,  
I have not modified my NR settings file to enable https (instructions were over my head). Not do I know how to configure a TLS config as if NR is a browser (this time overwhelmed by amount of certificates in the OS).

Hence, I assume my Nose Red does not know how to call an https service, including your SSE client. I did try to prefix url with https, and without but no luck.

The NR-contribute-https behaves just like standard http service node, and has embedded TLS.  
I use the node to call a Slack webhook, rudimentary, yes, but this way I sidestep to have to understand OAuth for Slack (do not tell me you see a theme here)

In simple facts  
I imported the demo flow for SSE-client, I deployed the tab, and I did look for green for (connection established). There it fails.  
Node Red instance is new for now 5 days, as is the Ubuntu 18.04 VM in Azure. Outbound https traffic is no issue (slack webhook)

Does this help to frame my issue?

Thanks, Eelco

[Next page](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025.md?page=2)
