Hi,
I was trying to create some endpoints on my own server that talk to the openBalena API via the Node.js SDK. Gathering data via balena.models.device.get(<uuidOrId>)
seems to work fine. This is (probably) because most of it is from the database itself.
However, when I’m trying to reboot a device via the SDK, via balena.models.device.reboot(<uuidOrId>, { force: false })
, I get the following error:
tunneling socket could not be established, cause=connect ECONNREFUSED 178.62.251.244:3128
The IP address is unknown for me, so that’s probably the reason why it’s failing. But I don’t really know how to debug this, because how did it get that IP address in the first place? My VPN is running on another IP address and the API and Registry also doesn’t run on that IP address.
On further investigation, that’s the IP address of the current server it’s running on. However, also for scaling purposes, not everything runs on the same server. So the VPN runs on it’s own server, and the API on its own server. In front of the API and the VPN, there are load-balancers. It should try to connect to the IP address of the Load Balancer instead of the server itself probably. Is this even possible at this time?
Thanks in advance!