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

Sessions break when printing non-small amount of data with SSL enabled - ttyd sending too large frames? #1428

Open
psznm opened this issue Mar 6, 2025 · 1 comment
Labels

Comments

@psznm
Copy link

psznm commented Mar 6, 2025

Describe the bug
My terminal session is breaking when printing non-small amount of data into terminal. Websocket is closed with code 1006 without additional info provided. This happens only when ttyd server is configured to use https with --ssl

To Reproduce
Steps to reproduce the behavior:

  1. Open terminal via server provided by ttyd with https --ssl option + related
  2. Run dd if=/dev/urandom count=1000 | stdbuf -o20K base64 this should print around 700kb random data in 20kb chunks. This amount resulted in very reliable bug reproduction for me.

Expected behavior
Terminal session does not break

Environment:

  • OS: Ubuntu 22.04
  • Browser: Firefox 135.0.1 AND Chrome 129.0.6668.89
  • ttyd 1.7.4 installed by apt on Ubuntu 24.04 (I haven't tested with newest version, but read changelog and didn't find anything that looked related)

Additional context

The ttyd server with -d 100 logs printed this during the breakage

[2025/03/06 12:09:44:5068] N: GOAWAY: last sid 0, error 0x00000001, string ''
[2025/03/06 12:09:44:5087] N: WS closed from xx.xx.xx.xx, clients: 0

When I inspected the situation in firefox "about:logging" I found these lines I think are relevant:

2025-03-06 10:23:23.180376 UTC - [Parent 5989: Socket Thread]: I/nsHttp Got frame too large 0x0043F2
2025-03-06 10:23:23.180392 UTC - [Parent 5989: Socket Thread]: I/nsHttp Http2Session::SessionError 7f126c381400 reason=0x1 mPeerGoAwayReason=0x1f

When I inspected the messages via browser console, the largest successful message I've seen was little over 12kb

@psznm psznm added the bug label Mar 6, 2025
@psznm
Copy link
Author

psznm commented Mar 13, 2025

This issue has been solved for me by running the ttyd on http and connecting to ttyd via proxy which handles the SSL, suggesting that ttyd or the websocket library used must be somehow mishandling SSL.

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

No branches or pull requests

1 participant