# "RequestError: socket hang up"

**URL:** https://discourse.nodered.org/t/requesterror-socket-hang-up/84509
**Category:** General
**Tags:** http-request
**Created:** [12 January 2024 11:32 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509 "2024-01-12T11:32:07Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sabir](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sabir](https://discourse.nodered.org/u/sabir)
#### Post date: [12 January 2024 11:32 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/1 "2024-01-12T11:32:07Z")

</div>

I'm using http-request node to call with api, if my api takes more than a minute to response, I'm getting error: "RequestError: socket hang up" exactly after one minute

How can I increase the request time-out to more than a minute

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [12 January 2024 11:54 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/2 "2024-01-12T11:54:20Z")

</div>

Is it normal that it takes so long?

You can change the timeout in the settings file

```js
/** Timeout in milliseconds for HTTP request connections.*/
httpRequestTimeout: 120000

```

---

<div class="post-metadata">

### Author: ![sabir](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sabir](https://discourse.nodered.org/u/sabir)
#### Post date: [12 January 2024 12:33 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/3 "2024-01-12T12:33:22Z")

</div>

Thanks for the response,  
Even I increase it to 12000, It still giving "RequestError: socket hang up" exactly after 1 minutes

 ![Screenshot from 2024-01-12 18-02-00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e20733cdd5b0f6e8c105432c9feb994c1f618497.png)

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [12 January 2024 12:43 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/4 "2024-01-12T12:43:59Z")

</div>

Checks the URL used and if it must contain a property to work.

It could happen that it is just an error of choice http/https

Without more information on this API it's hard to say

By the way, shouldn't you use the http-request node?

---

<div class="post-metadata">

### Author: ![sabir](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sabir](https://discourse.nodered.org/u/sabir)
#### Post date: [12 January 2024 12:56 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/5 "2024-01-12T12:56:42Z")

</div>

yeah I used http-request node

---

<div class="post-metadata">

### Author: ![sabir](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sabir](https://discourse.nodered.org/u/sabir)
#### Post date: [12 January 2024 13:04 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/6 "2024-01-12T13:04:39Z")

</div>

Do I have to connect setting.js file somewhere or it is automatically connected when I ran node-red locally?

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [12 January 2024 13:11 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/7 "2024-01-12T13:11:09Z")

</div>

No, it's global config loaded when NR starts

---

<div class="post-metadata">

### Author: ![sabir](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sabir](https://discourse.nodered.org/u/sabir)
#### Post date: [12 January 2024 15:21 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/8 "2024-01-12T15:21:48Z")

</div>

![Screenshot from 2024-01-12 20-49-15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/952c9a5631fb78199c2a37da7b647b68296a4399.png)  
And passing json {"prompt": "What is ..."} which I sending in the api body  
exactly it is waiting of 1 minute, If the api give the response within 1 minute then it works fine

---

<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: [12 March 2024 15:22 UTC](https://discourse.nodered.org/t/requesterror-socket-hang-up/84509/9 "2024-03-12T15:22:06Z")

</div>

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