Looks like "node-red-contrib-http" has been deprecated. Searching Library I found "node-red-contrib-http-request" but haven't tried that one. Looking for recommendation
Hi. Welcome to the forum.
Question: Why are you installing http nodes when node-red has http-request built in?
https is what I'm looking for. Trying to give responses to a webhook server that requires https
To clarify. You are creating an endpoint in node-red that an external application calls?
Or the other way around (node-red calls an external application)
Yes, external cloud host sending status updates messages that I will point at my node-red install. Should be able to string match and trigger something else. I don't control the host side and it requires https for sending events.
BTW: I have configured certificates and https is working for dashboard access.
Ok, well the 2 nodes you have mentioned were for making http(s) requests from node-red.
Regarding securing node-red, how do you access the node-red editor (via http://xxx
or https://xxx
)
https, used Certbot ACME client to generate the keys. That part is working!
Then you are all set. just create your endpoint using the built-in http-in -> http-response nodes.
Cookbook: Create an HTTP Endpoint : Node-RED
I can't use the built in if the host is making https request...right? I was assuming I needed to install a different note capable of deciphering https request.
If you access node-red via HTTPS then any endpoint you create using the http-in nodes will be accessible via HTTPS.
The http-in URL is relative to the editor.
GOOD to know... thank you!
I have a similar setup. here is my nginx config snippet with http basic auth:
location /api/ {
autoindex off;
auth_basic "Auth for http-nodes";
auth_basic_user_file /etc/apache2/.htpasswd;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:1880/api;
}
in setting.js i set httpNodeRoot: '/api'
so in the editor, i get:
That may be the clue I needed! I see the key is defining the API string. I was a bit confused how node-red would distinguish requests between dashboard access and node processing.
you can add whatever you like in the URL field including...
/api/v1/my_endpoint
(static route)/api/v1/my_endpoint/:param1/data/:param2
(dynamic route)/fred/blogs/*
(wildcard route)
Any Parameters parsed from the URL will be available in msg.params
In short, you dont NEED to set httpNodeRoot
Yeah, but this setting prevent me doing dump Things after i forget what flow is doing after 1 year xD
I also set httpAdminRoot: '/admin',