Local Connections work but Remote Connections do not

I'm using a vpn tunnel through a 4g lte connection to access node-red running on a Windows10 machine. The browser on the local machine can bring up the flow editor @ 127.0.0.1:1880 however remote machines connecting in through the vpn can not. The browser on a remote machine will throw these errors in the web console:

Loading failed for the with source “http://192.168.70.125:1880/vendor/vendor.js”.
Loading failed for the with source “http://192.168.70.125:1880/red/red.min.js”.
Uncaught ReferenceError: $ is not defined
http://192.168.70.125:1880/red/main.min.js:16

When I go to get the vendor.js file from the remote machine and compare it to the local one it appears that it does not finish loading.

vendorLocal.txt (1.0 MB) vendorRemote.txt (910.2 KB)

I'm not sure what I'm up against here. I've tried completely removing node.js and node-red and reinstalling, I've tried both Node.js 12x and 14x, i've tried with the modules I need installed and without. I've created my own secret key for the credientials in the settings file. I've tried extending timeouts in the settings file.

settings.txt (12.9 KB)

Here's my console output:

Welcome to Node-RED

18 Nov 05:56:58 - [info] Node-RED version: v1.2.3
18 Nov 05:56:58 - [info] Node.js version: v12.19.0
18 Nov 05:56:58 - [info] Windows_NT 10.0.17763 x64 LE
18 Nov 05:57:02 - [info] Loading palette nodes
18 Nov 05:57:04 - [debug] Module: node-red-contrib-bitunloader 0.3.7
18 Nov 05:57:04 - [debug] \Users\user.node-red\node_modules\node-red-contrib-bitunloader
18 Nov 05:57:04 - [debug] Module: node-red-contrib-google-sheets 0.1.0
18 Nov 05:57:04 - [debug] \Users\user.node-red\node_modules\node-red-contrib-google-sheets
18 Nov 05:57:04 - [debug] Module: node-red-contrib-modbus 5.13.3
18 Nov 05:57:04 - [debug] \Users\user.node-red\node_modules\node-red-contrib-modbus
18 Nov 05:57:04 - [debug] Module: node-red-contrib-simpletime 2.10.0
18 Nov 05:57:04 - [debug] \Users\user.node-red\node_modules\node-red-contrib-simpletime
18 Nov 05:57:04 - [debug] Module: node-red-node-rbe 0.2.9
18 Nov 05:57:04 - [debug] C:\Users\user\AppData\Roaming\npm\node_modules\node-red\node_modules\node-red-node-rbe
18 Nov 05:57:04 - [debug] Module: node-red-node-tail 0.1.1
18 Nov 05:57:04 - [debug] C:\Users\user\AppData\Roaming\npm\node_modules\node-red\node_modules\node-red-node-tail
18 Nov 05:57:11 - [info] Settings file : C:\Users\user.node-red\settings.js
18 Nov 05:57:11 - [info] Context store : 'default' [module=memory]
18 Nov 05:57:11 - [info] User directory : \Users\user.node-red
18 Nov 05:57:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Nov 05:57:11 - [info] Flows file : \Users\user.node-red\flows_DESKTOP-17JDQKF.json
18 Nov 05:57:12 - [info] Server now running at http://127.0.0.1:1880/
18 Nov 05:57:12 - [debug] loaded flow revision: 046e5fc8cbac13d47ca2a4fc7f4d34ce
18 Nov 05:57:12 - [debug] red/runtime/nodes/credentials.load : user provided key
18 Nov 05:57:12 - [debug] red/runtime/nodes/credentials.load : keyType=user
18 Nov 05:57:12 - [info] Starting flows
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : global
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : bf718b9e.88b41
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : be8c8591.07bae8
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : 5de50897.664488
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : 16a51d54.913093
18 Nov 05:57:12 - [debug] red/nodes/flows.start : starting flow : f5b9a037.b2e2a
18 Nov 05:57:13 - [info] Started flows

Thanks in advance for any help.

Can you bring up the editor locally using the full ip address? Try it on the machine running node-red and from another machine on the local network, if you have one.

Yes the machine running node-red responds at both 127.0.0.1:1880 and at 192.168.70.125:1880. There are no other devices that have web browsers on that LAN to check with.

How are you doing that?

Following the URL in the Browser's Developer Tools Web Console

Is this a new VPN setup?
Does the VPN work perfectly for other things?
What do you see if you run (remotely)
wget http://192.168.70.125:1880/vendor/vendor.js
Copy/paste the result, using the </> button at the top of the forum text window when pasting it here.
Run it a few times and see if you get different results

It is a new vpn but it has been working for a few weeks, it does work perfectly for several other things.

wget http://192.168.70.125:1880/vendor/vendor.js
--2020-11-18 16:25:10--  http://192.168.70.125:1880/vendor/vendor.js
Connecting to 192.168.70.125:1880... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1087724 (1.0M) [application/javascript]
Saving to: ‘vendor.js’

vendor.js                   100%[=========================================>]   1.04M  13.1KB/s    in 78s     

2020-11-18 16:26:28 (13.6 KB/s) - ‘vendor.js’ saved [1087724/1087724]

wget http://192.168.70.125:1880/vendor/vendor.js
--2020-11-18 16:27:10--  http://192.168.70.125:1880/vendor/vendor.js
Connecting to 192.168.70.125:1880... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1087724 (1.0M) [application/javascript]
Saving to: ‘vendor.js’

vendor.js                   100%[=========================================>]   1.04M  12.5KB/s    in 78s     

2020-11-18 16:28:29 (13.6 KB/s) - ‘vendor.js’ saved [1087724/1087724]

wget http://192.168.70.125:1880/vendor/vendor.js
--2020-11-18 16:29:28--  http://192.168.70.125:1880/vendor/vendor.js
Connecting to 192.168.70.125:1880... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1087724 (1.0M) [application/javascript]
Saving to: ‘vendor.js’

vendor.js                   100%[=========================================>]   1.04M  12.6KB/s    in 78s     

2020-11-18 16:30:47 (13.6 KB/s) - ‘vendor.js’ saved [1087724/1087724]


Well it has fetched ok, but your connection only seems to be running at 0.136Mbps which suggests you have a fundamental problem somewhere. Is it as slow as that if you use the vpn for other stuff or is it only node-red?
In a terminal on the node red machine run whatever tool shows you cpu performance etc in Windows and see if anything is hogging the processor or something.

CPU usage is reliably under 30% with node-red running.

Microsoft Windows [Version 10.0.17763.1577]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\user>typeperf "\Processor(_Total)\% Processor Time"

"(PDH-CSV 4.0)","\\DESKTOP-17JDQKF\Processor(_Total)\% Processor Time"
"11/18/2020 17:23:40.362","29.118851"
"11/18/2020 17:23:41.364","23.590350"
"11/18/2020 17:23:42.365","28.196667"
"11/18/2020 17:23:43.367","34.506008"
"11/18/2020 17:23:44.370","29.897576"
"11/18/2020 17:23:45.373","27.633275"
"11/18/2020 17:23:46.376","24.445369"
"11/18/2020 17:23:47.380","28.339866"
"11/18/2020 17:23:48.383","33.013400"
"11/18/2020 17:23:49.385","29.757693"
"11/18/2020 17:23:50.386","25.149626"
"11/18/2020 17:23:51.389","23.666508"

The command completed successfully.

The lte connection could actually be that slow due to cell service in the area. But sometimes I get a decent speedtest

   Speedtest by Ookla

     Server: CenturyLink - Orlando, FL (id = 10161)
        ISP: T-Mobile USA
    Latency:    41.95 ms   (2.57 ms jitter)
   Download:     7.04 Mbps (data used: 11.6 MB)
     Upload:     9.70 Mbps (data used: 13.9 MB)
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/36549a34-1d8a-45c6-8ec9-cd18d6f5
0567

What speed do you get if you try and copy a file from the node red machine, not using node red, just a file copy.

12KB/s

scp user@192.168.70.125:/C:/Users/user/Downloads/ookla-speedtest-1.0.0-win64.zip ~/Downloads/scpTest/speedtest.zip
user@192.168.70.125's password: 
ookla-speedtest-1.0.0-win64.zip                                                 100%  777KB  12.6KB/s   01:01

So what speed is that showing, and is it what you expect?

that is showing the speed at which a .zip file was copied through ssh from the windows machine through the vpn. The speed is slow and variable, but it is sufficient to do the other tasks I need it to. I can get away with just running the node-red editor on the windows machine, I just wanted to see if there was something I could do to configure node-red to get it to put up with a slow connection.

OK, I don't know whether it is the fact that you only have 140kbps available that is causing the problem, but that is incredibly low. Looking at the network traffic I can see that my dashboard is about 3MB total, which would take about 3.5 minutes to download, so I suspect what is happening is that the connection is timing out. I don't know whether there is anything you can do about that.

That suggests that it isn't your cellular connection that is causing the problem but something to do with the VPN.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.