# Troubleshooting http in node

**URL:** <https://discourse.nodered.org/t/troubleshooting-http-in-node/70857>\
**Category:** General\
**Created:** [18 November 2022 21:20 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857 "2022-11-18T21:20:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [18 November 2022 21:20 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/1 "2022-11-18T21:20:17Z")

</div>

I'm trying to create a pseudo REST proxy and can't even get basic functionality to work.

I have Node Red running on a RHEL 8 server in Azure. I can connect to it fine on 1880. In order to check basic functionality I have an `http in` node configured with `/ping` going to a template node with only the contents `pong` connected to a `http out` node.

If I use Postman to perform a GET request I get "Error: socket hang up". If I use CURL ON the VM I get:

```auto
$ curl http://localhost:1880/ping
curl: (52) Empty reply from server

```

It's probably something simple but I'm not sure what. Obviously the port is open or I couldn't access the node red interface.

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

What I'm trying to achieve is I have the CMMS Mainsaver which has a REST endpoint, but they want the payload to be Base64 encoded XML. The call will be coming from Tulip which does support XML REST calls, but not Base64 encoding.

I want Tulip to perform the request to Node Red in just XML, then I want to base64 encode the payload and then perform the request to Mainsaver on Tulip's behalf.

What am I missing?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [18 November 2022 21:39 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/2 "2022-11-18T21:39:53Z")

</div>

Looking at your image, i would guess that you have it configured to a GET request and path `/Ping!`. But that is just a guess as i can not see how you have configured things from a image of a flow.

try `http://localhost:1880/Ping!`

---

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [19 November 2022 13:35 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/3 "2022-11-19T13:35:50Z")

</div>

Unfortunately not that simple... In the URL field I just have `/ping`.

---

<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:** [19 November 2022 14:27 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/4 "2022-11-19T14:27:23Z")

</div>

Export that flow and paste it to a reply so people can see the code.

---

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [19 November 2022 14:41 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/5 "2022-11-19T14:41:12Z")

</div>

```auto
[
    {
        "id": "fc57aea1a9aa3b9f",
        "type": "debug",
        "z": "114c7a1d.fc85e6",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 320,
        "y": 720,
        "wires": []
    },
    {
        "id": "89db3bbf1a466ac5",
        "type": "http in",
        "z": "114c7a1d.fc85e6",
        "name": "[get] Ping!",
        "url": "/ping",
        "method": "get",
        "upload": false,
        "swaggerDoc": "",
        "x": 120,
        "y": 680,
        "wires": [
            [
                "7945676c9b44bde8",
                "fc57aea1a9aa3b9f"
            ]
        ]
    },
    {
        "id": "83c89f131c72a76e",
        "type": "http response",
        "z": "114c7a1d.fc85e6",
        "name": "Proxy Response",
        "statusCode": "",
        "headers": {},
        "x": 560,
        "y": 680,
        "wires": []
    },
    {
        "id": "7945676c9b44bde8",
        "type": "template",
        "z": "114c7a1d.fc85e6",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "Pong!",
        "output": "str",
        "x": 320,
        "y": 680,
        "wires": [
            [
                "83c89f131c72a76e"
            ]
        ]
    }
]

```

---

<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:** [19 November 2022 16:24 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/6 "2022-11-19T16:24:09Z")

</div>

Is NR on the same VM that you are running the curl on?

I installed Your flow on my local machine (IP 192.168.1.45) and both the curl and a `http://localhost:1880/ping` or `http://192.168.1.45:1880/ping` in a browser worked fine.

Going to another machine both the curl and `http://192.168.1.45:1880/ping`in a browser worked fine.

That brings it back to the VM. Not having any experience wth Azure, I'll have to bow out here.

---

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [19 November 2022 16:47 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/7 "2022-11-19T16:47:43Z")

</div>

I plan to do an update/restart of Node Red, but I have to wait until Sunday as this instance is used in production.

---

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [19 November 2022 18:07 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/8 "2022-11-19T18:07:52Z")

</div>

Wooo, testing in production. I too like to live dangerously.

---

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [19 November 2022 18:30 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/9 "2022-11-19T18:30:05Z")

</div>

Well, there's two things to that... 🙂

1. This was supposed to be my development server but we ended up solving problems and currently have no where to "export" the solution.
2. We're working on setting up an Azure IoT instance where I can hopefully dockerize each "solution" so they run independently.

---

<div class="post-metadata">

**Author:** ![hobbes1069](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hobbes1069/32/39892_2.png) [@hobbes1069](https://discourse.nodered.org/u/hobbes1069)\
**Post date:** [29 November 2022 14:09 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/10 "2022-11-29T14:09:45Z")

</div>

So I got it working, turns out I had to do `https://` instead of `http://`.

---

<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:** [28 January 2023 14:09 UTC](https://discourse.nodered.org/t/troubleshooting-http-in-node/70857/11 "2023-01-28T14:09:45Z")

</div>

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