I would like to set up a Node Red flow as a server to receive data from an app called Overland GPS. In the app you put a url with authentication etc to which the data is sent. My Node Red instance is externally reachable and I have authenication set up, but how do I build a flow so that it can receive data with the url that I set up the app with?
how easy it is to do depends upon the type of authentication. Take a look at the http request node
As I understand it I supply a url with my.node.red.ip/my.node.red.authentication and the appwillsendthat data to it. But how do I build the flow to receive it? Or am I missing something?
Ok so actually start with a http-input node and add a http-output and debug node.
That’s the most basic flow for a http server app in node-red.
Try it just with a webbrowser when you can get that to work then move onto your gps app.
take a look at the http endpoint section of the cookbook.
Once you have the http-in node set up such that it is externally reachable, you will then want the next part of your flow to validate the "HTTP Authorization header" which the app sets. This will be available on the input msg in Node-RED, just add a debug node set to show the whole msg.
You will - I really hope - have your connection set up to only use HTTPS so that data is encrypted point-to-point. If you don't, anyone could intercept the traffic - including the authorisation header - and then spoof it. One way to do this without exposing the whole of Node-RED to the Internet (generally not the best of ideas) - is to use NGINX or HAproxy as the HTTPS endpoint. That way you don't need to change Node-RED, only the proxy.