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 terminates with "Connection Closed: 1006" if a message bigger than 64 kB is sent #389

Closed
KaliszAd opened this issue May 14, 2021 · 1 comment

Comments

@KaliszAd
Copy link

KaliszAd commented May 14, 2021

I am investigating a failure involving WebSockets with Sente from ClojureScript to a Clojure backend using Sente and Aleph. The connection terminates with error code 1006 (https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1). I managed to create messages just under 64 kB that work fine, messages just over 64 kB always fail.

I haven't found any such limit in Aleph or Sente (looked for anything starting with 64 and 65), can somebody please explain, what am I doing wrong? Could this be a problem with Transit or Aleph? Are there any other similar hard coded limitations for the message/ payload size?

Update: thanks to @hiredman in the Clojure Slack channel the limit is written here: https://github.com/clj-commons/aleph/blob/master/src/aleph/http/server.clj#L728 I still have no clear idea whether to increase the size or rather to split the communication into multiple parts.
From looking into get-sch-adapter in taoensso.sente.server-adapters.aleph the implementation doesn't seem to accept any options that could be consumed by websocket-connection in aleph.http.

@KaliszAd
Copy link
Author

I've added better support for Aleph options with this PR: Add support for websocket-connection options #390
This enables you to increase max-frame-payload to a more suitable size e.g. 1048576 and max-frame-size to 2097152 (bytes). This pushes the limit in such a way that it's no longer a problem for our use case.

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

1 participant