mirror of
https://git.proxmox.com/git/pve-xtermjs.git
synced 2026-01-27 06:40:37 +00:00
No description
`Error::new` allocates memory (see [148971]). This is bad in multi-threaded programs, which pve-xtermjs AFAIK is. If the fork occurs while the allocator lock is held by another thread, deadlocks can occur, since there's no one left in the new process to unlock the mutex. I do not believe this is UB, and modern libc offer protections against this issue, but this isn't POSIX-compliant and should preferably be avoided. `nix` provides a non-allocating `impl From<Errno> for std::io::Error`, which can be used instead. This ensures that the correct error code is forwarded to the parent process, instead of the default `-EINVAL`. [rust#148971]: https://github.com/rust-lang/rust/pull/148971 Signed-off-by: Yuki Sireneva <yuki.utk8g@gmail.com> Link: https://lore.proxmox.com/20251205124802.334198-1-yuki.utk8g@gmail.com |
||
|---|---|---|
| .cargo | ||
| termproxy | ||
| xterm.js | ||
| .gitignore | ||
| README | ||
xterm.js webclient and helper utility
=====================================
This repository contains the client and helper utility to use xterm.js [0] in
the web UI of Proxmox projects like Proxmox VE, Proxmox Mail Gateway or Proxmox
Backup Server.
[0]: https://xtermjs.org
To be able to relay between the frontend and a shell program/console running in
the backend, we provide a tool called termproxy to open a port (where our
websocketproxy connects to) and to open a PTY and execute a program.
For communication originating from the client towards the server, it implements
a simple packet-based protocol where everything is a string. The protocol
consists of the following messages:
* Normal Message
0:LENGTH:MSG
where LENGTH is the bytelength of the msg
* Resize Message
1:COLS:ROWS:
where COLS is the number of columns the client wants to resize to, and ROWS
the number of rows, respectively
* Ping Message
2
used to keep the connection between client and server alive
(we have a timeout of 5 minutes)
Every other input from the client will be ignored.
Communication from server to the client uses no protocol, the raw data coming
from the terminal/program will be forwarded 1:1, without any wrapping format.