Correct wssshc architecture - wssshc acts as SSH client, not SSH server

- Fixed fundamental misunderstanding of wssshc's role in the architecture
- wssshc now acts as SSH client connecting to target SSH server (localhost:22)
- Removed incorrect SSH server implementation that was listening for connections
- Implemented proper SSH client connection in handle_tunnel_request()
- Added forward_ws_to_ssh_server() for bidirectional forwarding
- Removed handle_ssh_server_connection() and related SSH server functions
- Fixed handle_tunnel_data() to send data directly to SSH server connection
- Eliminated need for data buffering since wssshc connects directly to SSH server
- Corrected tunnel flow: WebSocket → wssshc → SSH server (not SSH server → wssshc)
- Fixed socket management for direct SSH server connection
- Resolved 'waiting for SSH connection' issue by removing server listening code
- Implemented proper SSH client architecture matching original design intent
- Fixed race conditions by establishing SSH connection immediately on tunnel_request
- Removed unnecessary complexity from SSH server mode implementation
- Streamlined code by removing unused SSH server connection handling
- Fixed data flow to match intended architecture: wssshc receives from tunnel, forwards to SSH server
- Eliminated port binding conflicts by not listening on SSH port
- Corrected bidirectional forwarding between WebSocket and SSH server connection
parent 31c7eed6
This diff is collapsed.
...@@ -54,8 +54,7 @@ int frame_buffer_consume(frame_buffer_t *fb, size_t len); ...@@ -54,8 +54,7 @@ int frame_buffer_consume(frame_buffer_t *fb, size_t len);
void *forward_tcp_to_ws(void *arg); void *forward_tcp_to_ws(void *arg);
void *forward_ws_to_local(void *arg); void *forward_ws_to_local(void *arg);
void *handle_ssh_server_connection(void *arg); void *forward_ws_to_ssh_server(void *arg);
void *forward_ssh_client_to_target(void *arg);
void *tunnel_thread(void *arg); void *tunnel_thread(void *arg);
void handle_tunnel_request(SSL *ssl, const char *request_id, int debug); void handle_tunnel_request(SSL *ssl, const char *request_id, int debug);
void handle_tunnel_data(SSL *ssl, const char *request_id, const char *data_hex, int debug); void handle_tunnel_data(SSL *ssl, const char *request_id, const char *data_hex, int debug);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment