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

WebSocket writes are binary only #85

Open
freynder opened this issue Apr 11, 2023 · 2 comments
Open

WebSocket writes are binary only #85

freynder opened this issue Apr 11, 2023 · 2 comments

Comments

@freynder
Copy link

freynder commented Apr 11, 2023

I'm trying to send a JSON payload with websocket transport from server to client. The message is always sent as binary, even though the payload is text. This may cause compatibility issues with other libraries that expect text payloads for content type application/json, such as Krossbow. At least we should be able to specify the desired payload type.

I traced the call stack to StompServerWebSocketConnectionImpl::write which calls socket.writeBinaryMessage, I don't see any possiblity to enforce sending as text.

@freynder freynder added the bug label Apr 11, 2023
@vietj vietj added this to the 4.4.2 milestone Apr 11, 2023
@vietj
Copy link
Contributor

vietj commented Apr 11, 2023

@freynder are you interested in contributing an improvement ?

@freynder
Copy link
Author

freynder commented Apr 12, 2023

@vietj I'm interested, but looks like this is not a small task and may require core breaking changes as well (to support on the receiving side):

  • receiveFrame function in WebSocketImplBase.java: treats TEXT, BINARY and CONTINUATION types the same, and dispatch only the binary data Buffer to the handler. So we lose the frame type at this point + continuations cannot be aggregated anymore. This should be changed so we aggregate continuations and only send on completion, an object that still contains the type. Do you agree on this?

An alternative is to only concentrate on the sending part. That part should be rather simple and less invasive.

@vietj vietj modified the milestones: 4.4.2, 4.4.3 May 12, 2023
@vietj vietj modified the milestones: 4.4.3, 4.4.4-SNAPSHOT, 4.4.4 Jun 7, 2023
@vietj vietj modified the milestones: 4.4.4, 4.4.5 Jun 22, 2023
@vietj vietj modified the milestones: 4.4.5, 4.4.6 Aug 30, 2023
@vietj vietj modified the milestones: 4.4.6, 4.5.0 Sep 12, 2023
@vietj vietj modified the milestones: 4.5.0, 4.5.1 Nov 15, 2023
@vietj vietj modified the milestones: 4.5.1, 4.5.2 Dec 13, 2023
@vietj vietj modified the milestones: 4.5.2, 4.5.3 Jan 30, 2024
@vietj vietj modified the milestones: 4.5.3, 4.5.4 Feb 6, 2024
@vietj vietj modified the milestones: 4.5.4, 4.5.5 Feb 22, 2024
@vietj vietj modified the milestones: 4.5.5, 4.5.6 Mar 14, 2024
@vietj vietj modified the milestones: 4.5.6, 4.5.7, 4.5.8 Mar 21, 2024
@vietj vietj modified the milestones: 4.5.8, 4.5.9 May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants