http works - https creates Lost connection to server, reconnecting...

2,492 views
Skip to first unread message

Christian H.

unread,
Feb 14, 2017, 10:03:07 AM2/14/17
to Node-RED
Hi everyone!

NR is running on my VM. 
When i access the webservice via http://10.1.1.1:1880 everything is running fine.
No i tried to activate the https://10.1.1.1/nr/ with an entry in the ssl and ..  it works..

but when i now connect via this link https://10.1.1.1/nr/ 
i got this message 

Lost connection to server, reconnecting...

Does anyone have an idea?
Cheers Ch

Colin Law

unread,
Feb 14, 2017, 10:18:59 AM2/14/17
to node...@googlegroups.com
I don't understand, you say that https://10.1.1.1/nr/ works, then you
say you get the error for the same url.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/c82fb619-97c0-4d4e-bbd0-a0c56f46a3d5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Nick O'Leary

unread,
Feb 14, 2017, 10:41:28 AM2/14/17
to Node-RED Mailing List
Colin - that error is displayed in the editor and indicates the websocket it uses to connect to the runtime has failed.

Christian, can you look in the browser console for any network activity around /comms - or possibly /nr/comms depending how exactly you have it configured.

Nick

On 14 February 2017 at 15:18, Colin Law <cla...@gmail.com> wrote:
I don't understand, you say that https://10.1.1.1/nr/ works, then you
say you get the error for the same url.

Colin

On 14 February 2017 at 15:03, Christian H. <mch...@gmail.com> wrote:
> Hi everyone!
>
> NR is running on my VM.
> When i access the webservice via http://10.1.1.1:1880 everything is running
> fine.
> No i tried to activate the https://10.1.1.1/nr/ with an entry in the ssl and
> ..  it works..
>
> but when i now connect via this link https://10.1.1.1/nr/
> i got this message
>
> Lost connection to server, reconnecting...
>
> Does anyone have an idea?
> Cheers Ch
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/c82fb619-97c0-4d4e-bbd0-a0c56f46a3d5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.

Librae

unread,
Feb 15, 2017, 4:15:12 AM2/15/17
to node...@googlegroups.com
Colin,

I've met this issue before, as Nick said, it's because of websocket.
Therefore, I guess you need to ensure the connection of websockets.

To test it, just add a pair of websockets node to see if it works.

My case might be a bit different, I make a nginx reverse proxy for https purpose.
This issue happens when I only proxy http requests, and get resolved once I set up proxy for websockets.
That is, I add some directives to handle "upgrade" event of http.

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";


Librae

Librae

unread,
Feb 15, 2017, 4:16:21 AM2/15/17
to node...@googlegroups.com
Also for your reference, Christian

Christian H.

unread,
Feb 23, 2017, 1:25:41 AM2/23/17
to Node-RED
Ok sorry for the late reply. Here is what i got if i take a look on the console in the browser:

WebSocket connection to 'wss://10.1.1.1./nr/comms' failed: Error during WebSocket handshake: Unexpected response code: 404
a
@ red.min.js:16

vendor
.js:5 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
send @ vendor.js:5

16red.min.js:16 WebSocket connection to '
wss://10.1.1.1/nr/comms' failed: Error during WebSocket handshake: Unexpected response code: 404


I installed node red on a cent os machine , i am sure i have somewhere somehow a small problem 
i am using cent os, and do the redirect from http to https via an entry in the ssl.conf
what do i miss ? cheers ch

> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/c82fb619-97c0-4d4e-bbd0-a0c56f46a3d5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

Christian H.

unread,
Feb 23, 2017, 8:17:34 AM2/23/17
to Node-RED


Am Donnerstag, 23. Februar 2017 07:25:41 UTC+1 schrieb Christian H.:
Ok sorry for the late reply. Here is what i got if i take a look on the console in the browser:

WebSocket connection to 'wss://10.1.1.1./nr/comms' failed: Error during WebSocket handshake: Unexpected response code: 404
a
@ red.min.js:16

vendor
.js:5 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
send @ vendor.js:5

16red.min.js:16 WebSocket connection to '
wss://10.1.1.1/nr/comms' failed: Error during WebSocket handshake: Unexpected response code: 404


I installed node red on a cent os machine , i am sure i have somewhere somehow a small problem 
i am using cent os, and do the redirect from http to https via an entry in the ssl.conf
what do i miss ? cheers ch


i added this configuration in my httpd.conf 

<VirtualHost *:80>
  ServerName 10.1.1.1

  RewriteEngine On
  RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
  RewriteCond %{QUERY_STRING} transport=websocket    [NC]
  RewriteRule /(.*)           ws://localhost:18080/$1 [P,L]

  ProxyPass / http://localhost:1880/
  ProxyPassReverse / http://localhost:1880/
</VirtualHost>
 
I now have the same Problem on http :-)  what do i miss ?

Dave C-J

unread,
Feb 23, 2017, 1:03:23 PM2/23/17
to node...@googlegroups.com
is this meant to be 1880  Inline images 1

Christian H.

unread,
Feb 23, 2017, 2:25:18 PM2/23/17
to Node-RED
You are right there was an mismatch.
But anyway i solved the problem

Solution is to add this line before the other proxy pass entries.

ProxyPass "/nr/comms"  "ws://localhost:1880/comms"

After that i removed the rewrite rules. restarted the services and yes..  it was working
cheer
ch
Reply all
Reply to author
Forward
0 new messages