node RED websocket invalid frame header error

832 views
Skip to first unread message

Ritesh Sangwan

unread,
Oct 29, 2015, 4:48:34 PM10/29/15
to Node-RED
I am following the official docs for embedding node RED into existing application


Can anyone will tell me why the below code is failing on bluemix ?

The below is working fine for localhost and it will fail on bluemix deployment.


There is an endpoint /start which will mount the node RED app on the /red path of the main application.

When I access the /red route it is working fine. Then I stop the RED instance using RED.stop() and re-start it using the same method. But this time there is a popup saying "Lost Connection to the server" and this is the error in google chrome console

WebSocket connection to 'ws://myapp.mybluemix.net/red/comms' failed: Invalid frame header red.min.js:16

And this is the error in safari console

WebSocket connection to 'ws://myapp.mybluemix.net/red/comms' failed: Compressed bit must be 0 if no negotiated deflate-frame extension
I am not sure what I am doing wrong and I am struggling with this issue since 4 days now.
How to fix this issue ?

Nicholas O'Leary

unread,
Oct 29, 2015, 4:54:41 PM10/29/15
to Node-RED Mailing LIst
Hi,

our embedding API needs some work. Repeatedly starting/stopping the node-red engine isn't something we test - the main node-red application only ever starts it when the app starts, and stops when the app stops. So it is possible it is related to us not tidying something up properly when you stop the runtime.

Tidying up the engine api is definitely on our todo list for the near future, but right now I don't have a specific solution to the issue you're seeing.

Nick

--
http://nodered.org
---
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.
For more options, visit https://groups.google.com/d/optout.

Ritesh Sangwan

unread,
Oct 30, 2015, 1:26:34 PM10/30/15
to Node-RED
Hello Nick

I understand it may be because of repeatedly starting/stopping the node RED engine. Do you have a timeline when it will be properly tested.

Also, I was doing some research on this issue and this issue may be because of ssl. So can you tell me how can I enable ssh for node RED instance. In code I can see this commented line


Also lets assume that the app is deployed on heroku so heroku apps already has ssl certificates. For ex below is the link


So in this case how can I enable ssl for node RED instance. I don't have the privatekey file and certificate file. The ssl is added by the provider i.e, heroku.

Ritesh Sangwan

unread,
Oct 30, 2015, 2:38:40 PM10/30/15
to Node-RED
Hello Nick

I tested it, it is not because of the ssl connection. It is because of some bug in node RED. I filed a new issue here
Reply all
Reply to author
Forward
0 new messages