• Stefy Lanza (nextime / spora )'s avatar
    Implement correct SSH tunneling architecture for wssshc · 14eef6e4
    Stefy Lanza (nextime / spora ) authored
    - Fixed wssshc to act as SSH server that forwards to target SSH server
    - Added handle_ssh_server_connection() to accept SSH client connections
    - Added forward_ssh_client_to_target() for bidirectional SSH forwarding
    - wssshc now listens on available port and accepts SSH client connections
    - wssshc connects to target SSH server (localhost:22) when tunnel is established
    - Implemented proper SSH protocol bridging between SSH client and target server
    - Fixed socket lifecycle management for SSH server mode
    - Resolved 'Bad file descriptor' issues by correcting connection architecture
    - SSH client now gets proper SSH server responses instead of immediate disconnection
    - Added proper error handling for SSH connection establishment and forwarding
    - Implemented correct tunnel flow: SSH client → wssshc → target SSH server
    - Fixed WebSocket integration with SSH protocol forwarding
    - Added comprehensive debug logging for SSH connection lifecycle
    - Resolved premature socket invalidation by maintaining proper connection state
    14eef6e4
tunnel.c 35.1 KB