feat: support single-host direct tunnels (ssh -L style)#863
Merged
Conversation
Add direct tunnel mode that uses a single SSH host for port forwarding, matching the behavior of ssh -L / ssh -R / ssh -D without requiring a second endpoint host in the Termix database. The Termix server creates a local TCP listener and forwards through the SSH channel directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssh -L/ssh -R/ssh -Dequivalent) — no second endpoint host required in the Termix databasebindHost:sourcePortand forwards each connection through the SSH channel viaforwardOuttotargetHost:endpointPorton the remote hostbindForwardInto listen on the remote host, forwards back to a local port on the Termix serverisSingleHostTunnel()detects when endpoint is absent,127.0.0.1,localhost, or identical to the source — automatically routes to the direct tunnel pathssh -Luse case the defaultremotetolocalto match PuTTY/Termius behaviorContext
Users coming from PuTTY, Termius, and MobaXterm expect to create simple local port forwards (e.g.,
ssh -L 8006:localhost:8006 remote-hostfor Proxmox GUI access). The existing S2S tunnel architecture requires two Termix-managed SSH hosts (source + endpoint), which confused users and made basic forwarding impossible without registering the same host twice.This was raised in Discord by multiple users (Antiager, NyvenZA, frenzykiwi) and was the root cause of the
"Endpoint host not found in database"error.Linked issues
Related discussion in Termix-SSH/Support (Discord thread, no GitHub issue)
Validation
npx tsc --noEmit --pretty falsenpm run buildChecklist