FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
03-07-2022 05:22 PM - edited 03-07-2022 05:27 PM
Hello everybody,
I want to receive json data through http from my device. However, when I run Node-Red on the virtual ctrlX i don't receive any data.I've tested the flow on Node-Red on my local PC and it can receive http requests, but when I try to do the same on the ctrlX i don't receive any data.
For the Flow I am simply using the http input node and reply with status 200.
So simply the http node on the ctrlX is an https server.
kind Regards,
Mohamed
Solved! Go to Solution.
03-09-2022 01:19 PM
We already did some test using the same architecture then you and it is working well.
How is your ctrlX CORE virtual running? In Network adapter or port forwarding mode? In the second case you would have to add e.g. 1880:1880 to your port list.
Are you using any VPN client on your PC that can block TCP communication?
03-09-2022 02:09 PM
Hello Thank you for your reply.
When I do that i disconnect the vpn. The port forwarding is active, but why should I add port 1880, i don't really get it.
So regarding the HTTP request I am simply using the standard Node-Red node http in, where the URL is relative to node-red it looks like:
URL: 127.0.0.1:8443/node-red/input
When I try sending HTTP Posts through Postman I get the error that I am trying to send HTTP request to an HTTPS server.
The Node-Red flow is really simple it cosists only of http in node and http response node with status code 200.
03-10-2022 12:11 PM
When using the 8443 I think our reverse proxy will block it because is responsible for this port and only accepts https request.
1880 is a standard port of Node-RED (and many other http based applications)
03-10-2022 12:31 PM
yes, thats the standard.
But the virtual ctrlX is running on port 8443 and node-red is running on the ctrlX using page "node-red". Ending up with the URL https://127.0.0.1:8443/node-red/.
So when creating an HTTP server on Node-Red it has a URL https://127.0.0.1:8443/node-red/HTTP-Server.
I do not know how I can set it up to run on port 1880 as you mentioned? Do you have any suggestion how I can do that?
03-10-2022 12:57 PM - edited 03-10-2022 01:06 PM
I did some tests and 1880 ist not needed in portforwarding list.
I created a test flow and used a REST client accessing this adress: https://127.0.0.1/node-red/alive
03-10-2022 01:16 PM
yes, that's right, but what you are doing is accessing an HTTPS Server and not an HTTP server.
I tested accessing the HTTP Server using Postman and it kept complaining that I am trying to send HTTP requests to an HTTPS server.
I would use an HTTPS request, but my connected device can only send HTTP requests. I tried as well as you said to use port 1880 by using a node Red node enabling the creation of HTTP servers on custom ports (such as 1880) and you can do that on Node-Red when it doesn't run on the ctrlX, but when trying to the same on the ctrlX the HTTP server on port 1880 cannot be created (on any custom port). Is it possible to create an app that opens an HTTP server on the ctrlX and then writes the data on the data layer, then I would be able to access the data through the data layer node on node-Red? Or is it not possible, due to security reasons?
03-10-2022 02:16 PM - edited 03-10-2022 02:33 PM
In your own app you can open up any port as you like to the outer world and also be provider of data to the Data Layer. You can even be provider of data from the outside.
EDIT:
You can even add open source version of Node-RED to an own app and use this one.
I will do some tests with http on Node-RED and post feedback here.
03-11-2022 09:26 AM
I had some discussions with our R&D.
Our ctrlX CORE - Node-RED App is already strengthened for security purposes. So all communication is only working via the reverse proxy and so needs https.
You could install the open source version of the "normal" Node-RED snap to your ctrlX CORE then you are not bound to our security mechanisms. But beware that there is no warranty, bug fixing or intense support for this way. See this thread for further information.