Remove PTY-level keepalive #449
@@ -1,8 +1,8 @@
|
|||||||
cask "termix" do
|
cask "termix" do
|
||||||
version "VERSION_PLACEHOLDER"
|
version "1.9.0"
|
||||||
sha256 "CHECKSUM_PLACEHOLDER"
|
sha256 "8fedd242b3cae1ebfd0c391a36f1c246a26ecac258b02478ee8dea2f33cd6d96"
|
||||||
|
|
||||||
url "https://github.com/Termix-SSH/Termix/releases/download/release-#{version}-tag/termix_macos_universal_#{version}_dmg.dmg"
|
url "https://github.com/Termix-SSH/Termix/releases/download/release-#{version}-tag/termix_macos_universal_dmg.dmg"
|
||||||
name "Termix"
|
name "Termix"
|
||||||
desc "Web-based server management platform with SSH terminal, tunneling, and file editing"
|
desc "Web-based server management platform with SSH terminal, tunneling, and file editing"
|
||||||
homepage "https://github.com/Termix-SSH/Termix"
|
homepage "https://github.com/Termix-SSH/Termix"
|
||||||
@@ -80,16 +80,16 @@ Supported Devices:
|
|||||||
- Windows (x64/ia32)
|
- Windows (x64/ia32)
|
||||||
- Portable
|
- Portable
|
||||||
- MSI Installer
|
- MSI Installer
|
||||||
- Chocolatey Package Manager (coming soon)
|
- Chocolatey Package Manager
|
||||||
- Linux (x64/ia32)
|
- Linux (x64/ia32)
|
||||||
- Portable
|
- Portable
|
||||||
- AppImage
|
- AppImage
|
||||||
- Deb
|
- Deb
|
||||||
- Flatpak (coming soon)
|
- Flatpak
|
||||||
- macOS (x64/ia32 on v12.0+)
|
- macOS (x64/ia32 on v12.0+)
|
||||||
- Apple App Store (coming soon)
|
- Apple App Store
|
||||||
- DMG
|
- DMG
|
||||||
- Homebrew (coming soon)
|
- Homebrew
|
||||||
- iOS/iPadOS (v15.1+)
|
- iOS/iPadOS (v15.1+)
|
||||||
- Apple App Store
|
- Apple App Store
|
||||||
- ISO
|
- ISO
|
||||||
|
|||||||
@@ -316,7 +316,6 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
|||||||
|
|
||||||
let sshConn: Client | null = null;
|
let sshConn: Client | null = null;
|
||||||
let sshStream: ClientChannel | null = null;
|
let sshStream: ClientChannel | null = null;
|
||||||
let pingInterval: NodeJS.Timeout | null = null;
|
|
||||||
let keyboardInteractiveFinish: ((responses: string[]) => void) | null = null;
|
let keyboardInteractiveFinish: ((responses: string[]) => void) | null = null;
|
||||||
let totpPromptSent = false;
|
let totpPromptSent = false;
|
||||||
let isKeyboardInteractive = false;
|
let isKeyboardInteractive = false;
|
||||||
@@ -802,8 +801,6 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
setupPingInterval();
|
|
||||||
|
|
||||||
if (initialPath && initialPath.trim() !== "") {
|
if (initialPath && initialPath.trim() !== "") {
|
||||||
const cdCommand = `cd "${initialPath.replace(/"/g, '\\"')}" && pwd\n`;
|
const cdCommand = `cd "${initialPath.replace(/"/g, '\\"')}" && pwd\n`;
|
||||||
stream.write(cdCommand);
|
stream.write(cdCommand);
|
||||||
@@ -1279,11 +1276,6 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
|||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pingInterval) {
|
|
||||||
clearInterval(pingInterval);
|
|
||||||
pingInterval = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sshStream) {
|
if (sshStream) {
|
||||||
try {
|
try {
|
||||||
sshStream.end();
|
sshStream.end();
|
||||||
@@ -1320,24 +1312,12 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
|||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupPingInterval() {
|
// Note: PTY-level keepalive (writing \x00 to the stream) was removed.
|
||||||
pingInterval = setInterval(() => {
|
// It was causing ^@ characters to appear in terminals with echoctl enabled.
|
||||||
if (sshConn && sshStream) {
|
// SSH-level keepalive is configured via connectConfig (keepaliveInterval,
|
||||||
try {
|
// keepaliveCountMax, tcpKeepAlive), which handles connection health monitoring
|
||||||
sshStream.write("\x00");
|
// without producing visible output on the terminal.
|
||||||
} catch (e: unknown) {
|
//
|
||||||
sshLogger.error(
|
// See: https://github.com/Termix-SSH/Support/issues/232
|
||||||
"SSH keepalive failed: " +
|
// See: https://github.com/Termix-SSH/Support/issues/309
|
||||||
(e instanceof Error ? e.message : "Unknown error"),
|
|
||||||
);
|
|
||||||
cleanupSSH();
|
|
||||||
}
|
|
||||||
} else if (!sshConn || !sshStream) {
|
|
||||||
if (pingInterval) {
|
|
||||||
clearInterval(pingInterval);
|
|
||||||
pingInterval = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 30000);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user