Skip to content

Add forward session support - #6

Open
vaurdan wants to merge 5 commits into
mainfrom
feature/forward-and-ssh-agent
Open

Add forward session support#6
vaurdan wants to merge 5 commits into
mainfrom
feature/forward-and-ssh-agent

Conversation

@vaurdan

@vaurdan vaurdan commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add ForwardSession for multiplexed socket/port forwarding via WebSocket
  • Add ForwardInfo/Forwards() for inspecting active forwards
  • Add ListenAddr to ForwardInfo for TCP relay support

@vaurdan vaurdan changed the title Add forward session and SSH agent support Add forward session support Jan 29, 2026
@vaurdan
vaurdan force-pushed the feature/forward-and-ssh-agent branch from bca8415 to aaab23c Compare January 29, 2026 09:53
- Add ForwardSession for multiplexed socket/port forwarding via
  WebSocket with ForwardInfo/Forwards() for inspecting active forwards
- Fix race condition: start readLoop after forward init completes
- Add SSH agent stream type (0x05) with bidirectional message handling
- Add WriteSSHAgent and WriteText methods to Cmd
- Add UpgradeURL field to APIError
When a TCP relay is active inside the sprite container, the server
returns the listen address (e.g., "localhost:25002") so clients can
display the transparent TCP endpoint instead of the Unix socket path.
Close() was holding fs.mu while closing channel connections. When
a connection is closed, the channel's readLoop() exits and calls
ch.close() which also tries to acquire fs.mu, causing a deadlock.

Fix by collecting channels while holding the lock, then closing
connections after releasing the lock.
@vaurdan
vaurdan force-pushed the feature/forward-and-ssh-agent branch from 412a978 to 48e6b7b Compare January 29, 2026 11:51
@vaurdan
vaurdan requested a review from mrkurt January 29, 2026 11:52
- Add preflight check to verify sprite is accessible before starting listener
- Use TCP RST instead of clean close on proxy errors for faster failure detection
- Add user-friendly warning messages with timestamps for connection failures
- Add debug logging throughout proxy connection flow
- Track fatal errors (401, 403, 404) and close session on fatal errors
@aezell

aezell commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

@vaurdan Things have drifted pretty significantly since this work was done. Is this reverse forwarding something we still need or want?

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

Successfully merging this pull request may close these issues.

2 participants