Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processing large messages - Websocket connection to 'ws://localhost:8080/' failed: Invalid frame header #15

Open
cordovapolymer opened this issue Sep 6, 2016 · 7 comments

Comments

@cordovapolymer
Copy link

When receiving large messages with mqtt-elements Websocket connection to 'ws://localhost:8080/' failed: Invalid frame header error occurs.

As per specification large messages have to be encoded differently.
I have found javascript implementation of this: http://stackoverflow.com/a/10402443

@sandro-k
Copy link
Contributor

sandro-k commented Sep 6, 2016

@cordovapolymer could you post an example to reproduce this and specify what a large message is. This is probably a bug at MQTT.js itself.

@cordovapolymer
Copy link
Author

cordovapolymer commented Sep 6, 2016

Full error is
WebSocket connection to 'ws://example.com:8000/ws' failed: Invalid frame header
WebSocket connection to 'ws://example.com:8000/ws' failed: One or more reserved bits are on: reserved1 = 0, reserved2 = 1, reserved3 = 1

One or more reserved bits are on: reserved1 = 0, reserved2 = 1, reserved3 = 1
it happens in mqtt-elements.js at line 7415 in instance = new WebSocket(uri, protocols);
Approximate message size is ~300KB.
I couldn't test it with your demo because it isn't showing received messages.

@sandro-k
Copy link
Contributor

sandro-k commented Sep 7, 2016

I am not able to reproduce this.. I am publishing a large message to the broker and correctly receive it at the client. Could you post the code that you are using to connect, subscribe and publish the message.

@cordovapolymer
Copy link
Author

cordovapolymer commented Oct 24, 2016

I am not able to reproduce this.. I am publishing a large message to the broker and correctly receive it at the client. Could you post the code that you are using to connect, subscribe and publish the message.

It seems that this error comes from mosquitto broker, I tried it with MQTT.js 2.0.1 and got the same error, and when switched to aedes it has disappeared.

@mcollina
Copy link
Member

There might be an issue on the difference between websocket-stream and a basic tls/net stream.

I'll try to see if I can assemble a PR.

@sandro-k
Copy link
Contributor

@mcollina wait until the end of the week. I will invest some time in mqtt-elements and update to the current mqtt.js version and will make some code cleanup.

@damouse
Copy link

damouse commented Aug 2, 2018

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants