[SOLVED] Jquery and ajax GET

Hi,

I have been able to use Jquery to make ajax calls to get variables and their values in an HTML Canvas widget, Very cool and very useful.

It occurred to me that I might be able to connect to my Node Red server/instance that I have running at home by using the same method but I am unable to connect. I get an error message (in the console) that says “ERR_CONNECTION_CLOSED”. I’m guessing that it’s the outgoing connection that is being refused, not refused at the Node Red end (Ubidots?).

Fair play if I can’t.

NB: I am able to make the connection using Postman and the port is being forwarded and is open.

Thanks,

Sean

How are you?

Can you a snippet of your code here and the screenshot of the ERR_CONNECTION_CLOSED error?

I’m thinking it could be caused because you’re trying to connect to a non-secure resource from Ubidots; as you can see, the website works over SSL and maybe is your browser the one that is closing this connection.

Regards!

David

I think you’re right re: the non-secure resource. My Node Red server is just running on a Raspeberry Pi on my home network (again, with the port definitely open).

For what it’s worth (for anyone trying to work this out too and found this by searching): I basically enabled HTTPS/SSL on my node-red server and now it works. I am still getting an error response, but the command is getting through. Should test with a POST and see what happens!

Thanks for your help!