# \[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:** 16
**Page:** 2

<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: [13 May 2020 05:53 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/21 "2020-05-13T05:53:45Z")

</div>

> [@Eelco](#):
>
> I have not modified my NR settings file to enable https

That is not relevant for this case. That is when you want to secure incoming directions, e.g. when you navigate from your pc to your Node-RED flow editor via https.  
In this demo my node calls a third-party server via https, so the third party has done the SSL setup.

> [@Eelco](#):
>
> Hence, I assume my Nose Red does not know how to call an https service

That is not correct. Node-RED can send http requests to third party services as long as your system is connected to the internet.

> [@Eelco](#):
>
> did look for green for (connection established)

Then your internet connection is ok ...

> [@Eelco](#):
>
> There it fails.

Do you have some errors in the node-red log perhaps?

---

<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: [13 May 2020 06:47 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/22 "2020-05-13T06:47:24Z")

</div>

I start from fresh, so we share same information

step 1 is to validate the demo through curl in command prompt of my W10-laptop, new per mid March  
curl -X GET --header "Accept:text/event-stream" "[https://proxy.streamdata.io/http://stockmarket.streamdata.io/prices/](https://proxy.streamdata.io/http://stockmarket.streamdata.io/prices/)"

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

Hmm, that is a new response. Did not see that one before but I can imagine it is blocking

Same curl command now on my NR host  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/f/2f25ea800c326ecf5f0570aa3546ba565a9837c4.png)

So there is something fishy about the demo. Are you able to inspect?

As for switch from http to https is base NR: the default http-request node can be used for https traffic, but then you need to set-up a tls config (client side!). I know how to do it for self-signed, but not for chain from commercial CA re-using what is already in OS (Mozilla)

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

---

<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: [13 May 2020 06:55 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/23 "2020-05-13T06:55:00Z")

</div>

And this is view from NR editor, Flow 3 is created fresh from import of SSE client demo. The connection error may be down to the certificate issue on proxy server

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/54b22a25be6a45b1d5df74f5d9ce7719fc0c9a2b.png)

Here is a working curl (sorry to hide account details). That one should go into SSE-client

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/465cce33092367f22da45c5d01a3decd076f493e.png)

Here is essential flow from your example, populated with working curl details

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/0/c062e2b83e05776ee45b5c991c1b2515443f0df8.png)  
Nothing special in pm2 logs node-red  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e6d3dd8184ca461f5518916db44ee1ee337f413.png)  
4 headers are present, same as in curl

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [13 May 2020 07:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/24 "2020-05-13T07:52:45Z")

</div>

> [@Eelco](#):
>
> As for switch from http to https is base NR: the default http-request node can be used for https traffic, but then you need to set-up a tls config (client side!). I know how to do it for self-signed, but not for chain from commercial CA re-using what is already in OS (Mozilla)

I might be extremely wrong here, but if the websites you’re attempting to reach have valid signed certificates that are acknowledged by CAs, **you don’t need to use the tls config**. Just like you don’t have to supply certificates yourself to your webbrowser (chrome/firefox/whatever) when you try to access the same page.

---

<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: [13 May 2020 11:12 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/25 "2020-05-13T11:12:47Z")

</div>

- So the website used in my demo has an expired certificate. Your curl in Windows doesn't mind about this, but on the NR host curl fails. I'm not using curl myself, but google shows me that indeed you might have to setup ca certs on your server to manage this. Or you need to use `curl -k` to disable certificate validation. But that is a bit too much off topic for this discussion about the sse-client node.

- However curl indeed gives some useful information about what might be going wrong with the demo.

- I see that you are also using another "_schiphol_" service. But there you haven't a certificate problem with curl on the NR host. So this is another issue I assume. Is that correct?

- I'm using [this](https://github.com/EventSource/eventsource) module under the hood, so cannot simply integrate logic from that https-node with it (although identical https settings 'might' be passed to the EventSource library). But I'm seeing in the EventSource repository two things I could try:

- But I have no clue why my demo works here on my system, and not on yours.

---

<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: [13 May 2020 15:19 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/26 "2020-05-13T15:19:13Z")

</div>

Well, I took my knowledge from configuring the node and there is this box to tick which then prompts you for TLS-config.  
But on your nudge I just gave it a try 🙂.  
Flow is like inject-httpRequest-debug (so a plain http request, all settings on default, injected payload is "help")  
Case 1 is [google.com](http://google.com). It does not flinch and returns code 200 plus unrendered content. Works as you suggest.  
Case 2 is [https://discourse.nodered.org/](https://discourse.nodered.org/). Same finding  
Case 3 is [klm.com](http://klm.com). I cannot get it working (nor through contribute-https), which tells me world of http calls is not trivial.  
So my hunch that the s in https is blocking may be wrong. Thanks for the lesson

So much for intuitive understanding

---

<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: [13 May 2020 15:41 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/27 "2020-05-13T15:41:00Z")

</div>

Thanks for thinking along.

- The expired certificate is actually blocking curl both on Windows and Ubuntu (all platforms in test). I would love to see your demo working again, would you have a tip who can I approach to get the cert updated?
- "Event source" is probably something server side in the demo. Change should not be required to get demo flowing again
- There might be another issue in accessing the "schiphol" service. For now I have no clue where to start looking why NR fails so I focus on a running SSE-client as step 1.
- Perhaps, as sidestep to fixing the demo, would you know of another SSE-emitter I can play with?

---

<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: [14 May 2020 21:19 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/28 "2020-05-14T21:19:05Z")

</div>

Hi @Eelco,

I have been reading some background information, and it seems I can now (in the latest version of the EventSource module) implement my own server certificate validation (based on CA root/intermediate certificates that a user needs to specify). However I don't have time to implement that now.

Don't know if this will solve your case, but I have created a new _ **0.2.2** _ version on Github which contains following changes:

- I have upgraded to the latest version of EventSource, which contains a number of improvements and bugfixes.

- I have added two new options (which are explained on my [readme page](https://github.com/bartbutenaers/node-red-contrib-sse-client/blob/master/README.md#reject-unauthorized-https-requests)):

This version has not been published on NPM yet, so you can install it directly from my Github account:

```auto
npm install bartbutenaers/node-red-contrib-sse-client

```

In this new version when I use my demo I get indeed this error:

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

But that is solved as soon as I deselect the _"Reject unauthorized https requests"_, since that skips the server certificate validation. So I hope this _ **workaround** _ solves your problem(s).

Remark: I'm aware that it would be more safe to add all the features to specify the CA certs, so you would be able to keep the server certificate validation enabled. If anybody wants to create a pull request, that would be fine because I have a lack of time ...

---

<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 June 2020 19:24 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/29 "2020-06-07T19:24:12Z")

</div>

Don't expect any feedback anymore whether my new version has fixed the problem, so I have published version _ **0.2.2** _ on npm:

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

---

<div class="post-metadata">

### Author: ![hansju-11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansju-11/32/74629_2.png) [@hansju-11](https://discourse.nodered.org/u/hansju-11)
#### Post date: [18 January 2023 22:00 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/30 "2023-01-18T22:00:01Z")

</div>

http post methode available?

I have this request:  
curl https://....mynetworkprovider..../api/v3/events -X POST -H "Authorization: mypassword token" -H "Accept: text/event-stream" --data '{"identifiers":[{"ids":{"id":"12345678"}}]}'

can I do this ?

---

<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: [18 January 2023 22:24 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/31 "2023-01-18T22:24:38Z")

</div>

Hi @hansju-11,

Not quite sure what you mean with this. The server pushes events to the clients, and this node allows Node-RED to act as one of those SSE clients. What do you want to post?

---

<div class="post-metadata">

### Author: ![hansju-11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansju-11/32/74629_2.png) [@hansju-11](https://discourse.nodered.org/u/hansju-11)
#### Post date: [18 January 2023 23:21 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/32 "2023-01-18T23:21:20Z")

</div>

Hello @BartButenaers,  
for me it looks like that the SSE Clients sent the request (URL) as GET method, my server will accept only POST method. [http GET VS POST](https://www.w3schools.com/tags/ref_httpmethods.asp). Is there a way to change the request method from get to post?

---

<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 January 2023 06:46 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/33 "2023-01-19T06:46:16Z")

</div>

@hansju-11,  
Ah ok now I understand your question. That makes sense indeed.

But I am using in my node the [eventsource](https://www.npmjs.com/package/eventsource) package as a dependency. You see in their [code](https://github.com/EventSource/eventsource/blob/master/lib/eventsource.js#L146) that they use the NodeJs http(s) module to send their GET requests. To send a POST request they need to change their code a little bit, as you can seen in the NodeJs [documentation](https://nodejs.org/api/http.html#httprequestoptions-callback) of the http module.

So if you can ask them (by registering an issue on their Github repo) if they can somehow make it possible to choose between get or post, then I will update my node afterwards to make this selectable in the config screen. Unfortunately I don't have time at the moment to digg into this myself.

---

<div class="post-metadata">

### Author: ![hansju-11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansju-11/32/74629_2.png) [@hansju-11](https://discourse.nodered.org/u/hansju-11)
#### Post date: [23 February 2023 06:47 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/34 "2023-02-23T06:47:04Z")

</div>

HEllo Bart,

request is done.

# [want feature http post request · Issue #316 · EventSource/eventsource (github.com)](https://github.com/EventSource/eventsource/issues/316)

We will see what will happen. Thank you for your support

---

<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: [11 March 2023 20:58 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/35 "2023-03-11T20:58:37Z")

</div>

Hi @hansju-11,  
What a pity you still got no response at all. Got today a similar [request](https://github.com/bartbutenaers/node-red-contrib-sse-client/issues/6) as your on Github...

---

<div class="post-metadata">

### Author: ![rakgupta](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rakgupta/32/42535_2.png) [@rakgupta](https://discourse.nodered.org/u/rakgupta)
#### Post date: [30 July 2026 15:30 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-sse-client/1025/36 "2026-07-30T15:30:00Z")

</div>

@BartButenaers - just to let you know that this is still being used! Teslemetry just introduced sse for Tesla energy and vehicles and this "just worked"! 🙏🏼

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