# Http-request-node "Enable connection keep-alive" seems not to work

**URL:** <https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225>\
**Category:** General\
**Created:** [15 June 2023 10:32 UTC](https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225 "2023-06-15T10:32:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyber](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Cyber](https://discourse.nodered.org/u/Cyber)\
**Post date:** [15 June 2023 10:32 UTC](https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225/1 "2023-06-15T10:32:52Z")

</div>

Hello,

I am using node red 3.0.2

I tick the setting "Enable connection keep-alive" in a request node. I do not set any headers or something else before, only an inject node (timestamp set there) fires constantly.

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

with tcpdump I can see, that the client request hast set "Connection: close". Also The complete TCP connection is always started from the beginning.  
Shouldn't the HTTP request node set "Connection: keep-alive" instead to leave the connection open for the next request?

Thanks!

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/704faa74c7ad883012fcfb22cd1f5f693fa7611f.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 June 2023 10:34 UTC](https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225/2 "2023-06-15T10:34:47Z")

</div>

Hi @Cyber

Can you raise an issue with these details?

I did a bunch of work on the request node for 3.1 and I remember seeing this, but it was a while ago and I cannot immediately recall whether I addressed it for 3.1 or not - either way, we should check.

---

<div class="post-metadata">

**Author:** ![Cyber](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Cyber](https://discourse.nodered.org/u/Cyber)\
**Post date:** [15 June 2023 10:48 UTC](https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225/3 "2023-06-15T10:48:33Z")

</div>

did so, thanks.

> <https://github.com/node-red/node-red/issues/4223>
>
> \### Current Behavior
> 
> http request node closes connection after each request, al…though "enable connection keep-alive" is ticked. there are no nodes in front of the http request node, only a inject node for periodically firing.
> 
> !\[image\](https://github.com/node-red/node-red/assets/11095760/3ea0a9fe-69de-4711-87df-471a26acab60)
> 
> with tcpdump I can see, that the client request hast set "Connection: close". Also The complete TCP connection is always started from the beginning.
> Shouldn't the HTTP request node set "Connection: keep-alive" instead to leave the connection open for the next request?
> 
> !\[image\](https://github.com/node-red/node-red/assets/11095760/39f3c28f-e749-416c-b184-794b1db7c3e3)
> 
> 
> \### Expected Behavior
> 
> set HTTP header "Connection" to "keep-alive" to let the server decide if the connection is terminated.
> 
> \### Steps To Reproduce
> 
> \_No response\_
> 
> \### Example flow
> 
> \`\`\`
> paste your flow here
> \`\`\`
> 
> 
> \### Environment
> 
> \- Node-RED version: 3.0.2
> \- Node.js version: v18.6.0
> \- npm version: 8.13.2
> \- Platform/OS: linux raspbian, debian version 10.13
> \- Browser: chrome

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 August 2023 10:49 UTC](https://discourse.nodered.org/t/http-request-node-enable-connection-keep-alive-seems-not-to-work/79225/4 "2023-08-14T10:49:28Z")

</div>

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