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

The header of a frame cannot be read from the stream. #4532

Open
2 tasks done
availableusername-node opened this issue Jan 14, 2025 · 1 comment
Open
2 tasks done

Comments

@availableusername-node
Copy link

Node.js Version

20.12.1

NPM Version

10.5.1

Operating System

Windows 10 22H2

Subsystem

Other

Description

Hi

We updated a node.JS application from node 12.16.3 / npm 6.14.4 to node 20.12.1 / npm 10.5.1. No we cannot connect the socketIO (websocket) client application made with .NET 4.7.2 SocketIOClient.NetFx V2.0.2.10. if we try to connect, the following error appears:

|Fatal|WebSocket.b__170_2|WebSocketSharp.WebSocketException: The header of a frame cannot be read from the stream.
at WebSocketSharp.WebSocketFrame.processHeader(Byte[] header)
at WebSocketSharp.WebSocketFrame.<>c__DisplayClass73_0.b__0(Byte[] bytes)
at WebSocketSharp.Ext.<>c__DisplayClass54_0.b__0(IAsyncResult ar)

We first thought that this might be a TLS problem and limited node to TLS1.2, but this did not help.

If we wire shark the https (wss) connection, we can see, that the connections get a TCP FIN after the second application data package. The only difference we can see is the window frame size (1024 vs. 4096). Is this causing the problem? How can we limit the window frame size? Or what else could cause this problem.

Image

Thanks
availableusername-node

Minimal Reproduction

No response

Output

No response

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@tryingtofindanunusedusername

After a few attempts, cursing and a lot of research, we downgraded the SocketIO node module from version 4.7.5 to version 2.5.0. And it worked again - yeah!

But then these two nasty Windows updates appeared and we were back to the same point.

Windows 10:
o KB5049981 Release date: January 14, 2025
o KB5050188 Release date: January 14, 2025

Windows 11:
o KB5050009 Release date: January 14, 2025
o KB5049622 Release date: January 14, 2025

But then the rescue! SocketIOClient.NetFx V2.0.2.10 is now obviously just called SocketIOClient, still by doghappy, and is available in version 3.1.2. After installing the corresponding .Net NuGet package, there were some compilation errors. Various methods no longer have the same name and the socket options no longer have the EnabledSslProtocols attribute. After these problems were resolved, the application could be compiled again. And now it works, even with the new SocketIO node module version 4.7.5.

Have fun...

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

2 participants