Overview
Implement comprehensive SSH port forwarding capabilities in bssh to support local (-L), remote (-R), and dynamic (-D) port forwarding, enabling full SSH tunneling functionality compatible with both single-host and multi-host cluster modes.
Technical Approach
The implementation uses russh's channel capabilities with a custom async forwarding manager built on Tokio. Key architectural decisions include:
- Async-first design for handling thousands of concurrent connections efficiently
- Centralized ForwardingManager for lifecycle management and monitoring
- Multiplexed channels over single SSH connections for resource efficiency
- Automatic reconnection with exponential backoff for resilience
- Graceful shutdown with proper resource cleanup on termination
Implementation Tasks
Phase 1: Foundation and Local Forwarding
Phase 2: Remote and Dynamic Forwarding
Phase 3: Multi-Host Support
Success Criteria
- Local port forwarding works identically to OpenSSH -L
- Remote port forwarding works identically to OpenSSH -R
- Dynamic forwarding provides full SOCKS v5 compatibility
- All forwarding types work in single-host and cluster modes
- Performance within 10% of OpenSSH for throughput
Labels
enhancement, help wanted, ssh-compat
Overview
Implement comprehensive SSH port forwarding capabilities in bssh to support local (-L), remote (-R), and dynamic (-D) port forwarding, enabling full SSH tunneling functionality compatible with both single-host and multi-host cluster modes.
Technical Approach
The implementation uses russh's channel capabilities with a custom async forwarding manager built on Tokio. Key architectural decisions include:
Implementation Tasks
Phase 1: Foundation and Local Forwarding
src/forwarding/mod.rs)Phase 2: Remote and Dynamic Forwarding
Phase 3: Multi-Host Support
Success Criteria
Labels
enhancement,help wanted,ssh-compat