HTTP In URL when using Node Red with HASS Supervisor

Hey All,

I am sure I am missing something mad obvious in all of this but I am really struggling to understand how I can POST a request to Node Red when it is installed using the Supervisor. I have tried all the obvious answers as well as added passwords to the config in case they were required (http_node and http_static) but no joy.

To test I have used the reference HTTP In example from the Node Red docs, export below.

[{"id":"836a6aef.2d74d8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"aec4d953.4fe2a8","type":"http in","z":"836a6aef.2d74d8","name":"","url":"/hello-form","method":"post","upload":false,"swaggerDoc":"","x":190,"y":200,"wires":[["a481477d.6f7b78"]]},{"id":"a481477d.6f7b78","type":"template","z":"836a6aef.2d74d8","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <head></head>\n    <body>\n        <h1>Hello {{ payload.name }}!</h1>\n    </body>\n</html>","x":420,"y":260,"wires":[["bdf8976f.bc1ff8"]]},{"id":"bdf8976f.bc1ff8","type":"http response","z":"836a6aef.2d74d8","name":"","statusCode":"","headers":{},"x":590,"y":300,"wires":[]}]

Then I have tried to send a simple JSON payload to add the addresses I can think that it might be binding to:

  • http[s]://myinstance.duckdns.org:1880/endpoint/hello-form
  • http[s]://192.168.1.120:1880/endpoint/hello-form
  • http[s]://myinstance.duckdns.org:8123/endpoint/hello-form
  • http[s]://192.168.1.120:8123/endpoint/hello-form
  • http[s]://myinstance.duckdns.org:8123/hassio/addon/a0d7b954_nodered/endpoint/hello-form

With or without SSL it fails every time with connection refused or times out when using the IP address. I can access the HASS UI from the duckdns no problem at all.

I’ve been trawling through the forums but every reference seems to point me in the direction of the first URL being the correct URL to receive the message. What probably extremely simple thing am I doing wrong trying to send in the POST payload? I’m on the same network at the service, it isn’t open to remote access so no router config should be causing issues.

Config in supervisor

1 Like

Not sure if it helps but I have:

image

image

image

And I call like this:
http://192.168.1.142:1880/endpoint/switch-vera-cas

1 Like

So just for the sake of testing I created a GET endpoint as /test-get that just responded with 200 and nothing else and then ran the tests again, but I am still getting connection refused.

I can only assume that for some reason the incoming connections are not routed to the docker container. When I use generic Node Red on my laptop in Docker the incoming request works correctly as expected so pretty sure it is something to do with my base setup??

Ah, did you do this:

Edit: i see you have done…

I also see you are using username and password…

try something like:
http://user:[email protected]:1880/endpoint/test-get

Yea sorry, forgot to mention I tried with and without the username and password (in the requests as well) in case it had something to do with enabling the connection to work.

Kinda stumped for what else I can try. No logs of attempted connections in Node Red and I can’t see any in the main HASS logs either as attempted connections to trace from.

Were you able to make it work? I’m having the same issue

same issue, no logs of attempted connections, just forbidden

just wondering where this is (network container setup) - did anyone get this issue resolved?

So, I had the same problem, and then it dawned to me that http://myinstance.duckdns.org:1880 requests need to be forwarded by the router to port 1880.

In my case requests using the internal ip were working (192.168.x.x/endpoint/test).

Ever since I forwarded the port requests, using the external url (http://myinstance.duckdns.org:1880/endpoint/test) seem to be working too.

I’ve not tested it with ssl, there seems to be some kind of problem with the certificates, I just was excited and rushed to post :slight_smile:

I don’t know what I’m doing wront… I try but the response are 404 page not found…
i use
https://myproxyrereverse/endpoint/apri-cancello