[GH-ISSUE #222] WebSocket connection fails with Error 400 #149

Closed
opened 2026-03-03 16:04:46 +03:00 by kerem · 6 comments
Owner

Originally created by @RogerG007 on GitHub (Jan 6, 2021).
Original GitHub issue: https://github.com/mthenw/frontail/issues/222

The newest openhabian release causes Frontail 4.9.1 to not being able to display any logs. On web console the fault message can be seen:

index.js:83 WebSocket connection to 'ws://192.168.0.51:9001/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

As a workaround, editing web/index.html and changing transports: ['websocket'] to transports: ['polling'] makes it workable again or alternatively, downgrading to 4.9.0.

Any idea what the real cause could be for this error message?

Originally created by @RogerG007 on GitHub (Jan 6, 2021). Original GitHub issue: https://github.com/mthenw/frontail/issues/222 The newest openhabian release causes Frontail 4.9.1 to not being able to display any logs. On web console the fault message can be seen: `index.js:83 WebSocket connection to 'ws://192.168.0.51:9001/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400` As a workaround, editing **web/index.html** and changing `transports: ['websocket']` to `transports: ['polling']` makes it workable again or alternatively, downgrading to 4.9.0. Any idea what the real cause could be for this error message?
kerem closed this issue 2026-03-03 16:04:47 +03:00
Author
Owner

@bwiessneth commented on GitHub (Jan 6, 2021):

Hi @mthenw,

with Socket.IO 2.4 the default CORS behavior changed, which breaks functionality for RogerG007's and openhabians's (a tailored raspberry distro for running openhab) use-case.

IMHO pinning the Socket.IO version to 2.3 or adding the CORS change should resolve this issue.

https://github.com/socketio/socket.io/issues/3740
https://socket.io/blog/socket-io-2-4-0/

<!-- gh-comment-id:755428661 --> @bwiessneth commented on GitHub (Jan 6, 2021): Hi @mthenw, with Socket.IO 2.4 the default CORS behavior changed, which breaks functionality for RogerG007's and openhabians's (a tailored raspberry distro for running openhab) use-case. IMHO pinning the Socket.IO version to 2.3 or adding the CORS change should resolve this issue. https://github.com/socketio/socket.io/issues/3740 https://socket.io/blog/socket-io-2-4-0/
Author
Owner

@mthenw commented on GitHub (Jan 8, 2021):

@bwiessneth do you mind creating a PR?

<!-- gh-comment-id:756754049 --> @mthenw commented on GitHub (Jan 8, 2021): @bwiessneth do you mind creating a PR?
Author
Owner

@bwiessneth commented on GitHub (Jan 8, 2021):

I was about to start on this when I saw that this (breaking) change was reverted with socket.io 2.4.1 (https://github.com/socketio/socket.io/releases/tag/2.4.1).

As long as the socket.io version string in pacakage.json stays like it is now, there should be no future issue with CORS / socket.io

<!-- gh-comment-id:756830517 --> @bwiessneth commented on GitHub (Jan 8, 2021): I was about to start on this when I saw that this (breaking) change was reverted with socket.io 2.4.1 (https://github.com/socketio/socket.io/releases/tag/2.4.1). As long as the socket.io version string in **pacakage.json** stays like it is now, there should be no future issue with CORS / socket.io
Author
Owner

@casperklein commented on GitHub (Feb 5, 2021):

My setup broke today and I guess my issue is related to this one. I was bravely using the latest tag of the docker image (which was rebuild yesterday). Afaik the only change was this: github.com/mthenw/frontail@38022f7a0a.

I am now using the 4.9.1 tag instead of latest and my setup is working again.

<!-- gh-comment-id:774094333 --> @casperklein commented on GitHub (Feb 5, 2021): My setup broke today and I guess my issue is related to this one. I was bravely using the `latest` tag of the docker image (which was rebuild yesterday). Afaik the only change was this: https://github.com/mthenw/frontail/commit/38022f7a0a6410cf67c9824053cbcb06d11c253e. I am now using the 4.9.1 tag instead of latest and my setup is working again.
Author
Owner

@CSchlipp commented on GitHub (Feb 8, 2021):

@mthenw: If no changes are required, would you simply update the docker image on docker hub with the latest node_modules?
The latest tag is unfortunately still referring to a non-working image...
Thanks!

<!-- gh-comment-id:775441871 --> @CSchlipp commented on GitHub (Feb 8, 2021): @mthenw: If no changes are required, would you simply update the docker image on docker hub with the latest node_modules? The latest tag is unfortunately still referring to a non-working image... Thanks!
Author
Owner

@mthenw commented on GitHub (Feb 17, 2021):

Should be fixed in 4.9.2.

<!-- gh-comment-id:780886844 --> @mthenw commented on GitHub (Feb 17, 2021): Should be fixed in 4.9.2.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/frontail#149
No description provided.