1. 18 Sep, 2025 19 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Implement bridge and script modes for wsssht · 5e5d32e5
      Stefy Lanza (nextime / spora ) authored
      - Added run_bridge_mode() function with JSON stdin/stdout interface
      - Added run_script_mode() function with JSON protocol for scripting
      - Bridge mode: JSON communication between stdin/stdout and WebSocket
      - Script mode: JSON status updates, command processing, and monitoring
      - Both modes provide structured JSON output for programmatic use
      - Fixed compilation warnings and ensured clean build
      - All operating modes now fully implemented
      5e5d32e5
    • Stefy Lanza (nextime / spora )'s avatar
      Implement daemon mode for lazy tunnel initialization · c9b8a6bb
      Stefy Lanza (nextime / spora ) authored
      - Added run_daemon_mode() function for lazy tunnel establishment
      - Daemon mode waits for first connection attempt before establishing tunnel
      - Reduces resource usage by not connecting until actually needed
      - Maintains all existing functionality after tunnel is established
      - Fixed compilation errors and ensured clean build
      - Updated mode handling to support daemon mode
      c9b8a6bb
    • Stefy Lanza (nextime / spora )'s avatar
      Remove WebSocket handshake debug messages unless --debug is enabled · bd114443
      Stefy Lanza (nextime / spora ) authored
      - Modified websocket_handshake() function to accept debug parameter
      - Updated all debug messages in websocket_handshake to only print when debug=1
      - Updated all callers of websocket_handshake() to pass debug flag
      - Fixed compilation warnings and ensured clean build
      - WebSocket handshake messages now only appear with --debug flag
      bd114443
    • Stefy Lanza (nextime / spora )'s avatar
      Fix compilation warnings in wsssht.c · 480285cd
      Stefy Lanza (nextime / spora ) authored
      - Fixed unused parameter warnings in run_bridge_mode and run_script_mode functions
      - Added parameter usage in debug output to eliminate compiler warnings
      - Compilation now clean with no warnings or errors
      480285cd
    • Stefy Lanza (nextime / spora )'s avatar
      Add --config option and update config files · 4a64994a
      Stefy Lanza (nextime / spora ) authored
      - Added --config FILE option to specify custom config file path
      - Removed [wssht] section from wsssh.conf.example (legacy)
      - Created separate wsssht.conf.example with wssht-specific options
      - Updated man page with new --config option and mode options
      - Updated usage message to include all new options
      - Config file validation: errors if specified file doesn't exist
      4a64994a
    • Stefy Lanza (nextime / spora )'s avatar
      Fix memory corruption in parse_connection_string · 2ed32275
      Stefy Lanza (nextime / spora ) authored
      - Fixed 'free(): invalid pointer' error when using service prefix format
      - Issue was caused by modifying the original allocated string and then trying to free a pointer to the middle of it
      - Added proper pointer tracking to ensure correct memory deallocation
      2ed32275
    • Stefy Lanza (nextime / spora )'s avatar
      Fix connection string precedence issue · 952e5687
      Stefy Lanza (nextime / spora ) authored
      - Connection string values now properly override config file values
      - Fixed issue where 'wsssht zeiss' wasn't working due to incorrect precedence logic
      - Command line options still take highest precedence, then connection string, then config file
      952e5687
    • Stefy Lanza (nextime / spora )'s avatar
      Add flexible connection string support to wsssht · 397200c8
      Stefy Lanza (nextime / spora ) authored
      - Support connection string format: [service://]clientid[@wssshd-host][:wssshd-port]
      - Command line options take precedence over connection string values
      - Update usage message and man page with new syntax
      - Add comprehensive documentation for connection string format
      - Maintain backward compatibility with existing option-based usage
      397200c8
    • Stefy Lanza (nextime / spora )'s avatar
      Fix wsssht argument parsing issue · c0a6998c
      Stefy Lanza (nextime / spora ) authored
      - Remove leftover logic for handling positional arguments in parse_args()
      - Since wsssht no longer accepts user@host arguments, remove the non-option argument handling
      - Remove unused parse_hostname() and parse_target_args() functions
      - Fix issue where valid options were triggering --help output
      c0a6998c
    • Stefy Lanza (nextime / spora )'s avatar
      Complete wsssht.conf.example with all configuration options · 60dc9f73
      Stefy Lanza (nextime / spora ) authored
      - Add tunnel-port option to wsssht.conf.example
      - Update man page configuration example to include all options
      - Reorder options logically in both files
      - Include comprehensive comments explaining each option
      60dc9f73
    • Stefy Lanza (nextime / spora )'s avatar
      Fix wsssht config file name from wssht.conf to wsssht.conf · 64ee57da
      Stefy Lanza (nextime / spora ) authored
      - Update all config file references from 'wssht' to 'wsssht'
      - Rename wssht.conf.example to wsssht.conf.example
      - Update man page to reflect correct config file names
      - Fix config reading calls to use 'wsssht' instead of 'wssht'
      64ee57da
    • Stefy Lanza (nextime / spora )'s avatar
      Update --tunnel option description in wsssht help · 00dbcc6a
      Stefy Lanza (nextime / spora ) authored
      - Change 'Transport types' to 'Transport' in --tunnel option description
      - Add 'or websocket' to the description for clarity
      - Update both usage message in wsssht.c and man page wsssht.1
      00dbcc6a
    • Stefy Lanza (nextime / spora )'s avatar
      Reorder wsssht --help options for better organization · 067dc0e5
      Stefy Lanza (nextime / spora ) authored
      - Move --wssshd-port option to appear right after --wssshd-host
      - Update both usage message in wsssht.c and man page wsssht.1
      - Maintain logical grouping of related options
      067dc0e5
    • Stefy Lanza (nextime / spora )'s avatar
      Add system-wide config support for wsssht with proper precedence · e4f83534
      Stefy Lanza (nextime / spora ) authored
      - Update read_config_value_from_file() to support config precedence:
        1. ~/.config/wsssh/wssht.conf (user config)
        2. /etc/wsssht.conf (system config)
      - Update man page to document config file precedence order
      - Command line options still have highest priority
      e4f83534
    • Stefy Lanza (nextime / spora )'s avatar
      Refactor wsssht: remove user@domain parsing, add --clientid and --wssshd-port options · 28dccf5b
      Stefy Lanza (nextime / spora ) authored
      - Remove parsing of user@domain format from wsssht
      - Add --clientid option for specifying client ID
      - Add --wssshd-port option (replacing -p/--port)
      - Update wssshd-host default to mbetter.nexlab.net
      - Add client_id field to wsssh_config_t struct
      - Update config reading to include clientid and wssshd-port
      - Update wssht.conf.example with new options
      - Update man page wsssht.1 with new options and examples
      - Ensure --wssshd-host is required if not in config
      - Update all usage messages and documentation
      28dccf5b
    • Stefy Lanza (nextime / spora )'s avatar
      Add --tunnel-host option to wsssht and change default timeout to 5 seconds · 42365291
      Stefy Lanza (nextime / spora ) authored
      - Add --tunnel-host option to specify local IP address for tunnel binding
      - Change default timeout from 30 to 5 seconds for wsssht
      - Update help text, man page, and config file to reflect changes
      - Update setup_tunnel function to accept tunnel_host parameter
      - Update socket binding to use specified tunnel_host or default to 127.0.0.1
      42365291
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add wsssht to Debian package · 9a91cb2a
      Stefy Lanza (nextime / spora ) authored
      - Update debian/control: Include wsssht in package description
      - Update debian/changelog: Add version 1.5.0 with wsssht and transport features
      - Update debian/rules: Install wssht.conf.example configuration file
      - Package now includes all four tools: wssshc, wsssh, wsscp, wsssht
      - Maintains backward compatibility with existing installations
      9a91cb2a
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add wsssht - WebSocket SSH Tunnel tool · 3ee9fd4a
      Stefy Lanza (nextime / spora ) authored
      - Create wsssht.c: Stripped-down tunnel setup tool (like wsssh --dev-tunnel)
      - Add separate wssht.conf configuration file support
      - Implement read_config_value_from_file() for custom config files
      - Create wssht.conf.example with tunnel configuration options
      - Update wsssht.1 man page with separate config file documentation
      - Add wsssht to build system (configure.sh, Makefile)
      - Test successful compilation and functionality
      
      wsssht provides manual tunnel setup without auto-executing SSH/SCP,
      displaying connection information for telnet, nc, or any TCP client.
      3ee9fd4a
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Implement peer-to-peer tunneling architecture with transport selection · cc27f590
      Stefy Lanza (nextime / spora ) authored
      - Add --tunnel, --tunnel-control, --service options to wsssh and wsscp
      - Implement transport definitions with is_relay property and weight-based selection
      - Add WebSocket transport with is_relay=true as primary transport
      - Update server-side tunnel handling for new transport attributes
      - Enhance configuration system with new tunneling options
      - Update all man pages with comprehensive tunneling documentation
      - Fix PyInstaller template loading for frozen executables
      - Add transport list expansion for 'any' option functionality
      - Implement connection retry logic with weight-based prioritization
      - Update CHANGELOG.md, TODO.md, README.md, and DOCUMENTATION.md
      cc27f590
  2. 17 Sep, 2025 21 commits
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add peer-to-peer tunneling architecture with transport selection · 25f2f3cb
      Stefy Lanza (nextime / spora ) authored
      - Add --tunnel, --tunnel-control, --service options to wsssh and wsscp
      - Implement transport definitions with is_relay property and weight-based selection
      - Add WebSocket transport with is_relay=true as primary implementation
      - Update server-side tunnel handling with new transport attributes
      - Enhance configuration system with tunneling options
      - Fix critical transport list expansion for 'any' option
      - Update all man pages with comprehensive tunneling documentation
      - Add new config files wsssh.conf.example and wsscp.conf.example
      - Update CHANGELOG.md, README.md, and TODO.md with new features
      - Maintain backward compatibility with existing functionality
      25f2f3cb
    • Stefy Lanza (nextime / spora )'s avatar
      Implement comprehensive tunnel status tracking and IP autodetection · ecd74f26
      Stefy Lanza (nextime / spora ) authored
      - Add IP autodetection function in wssshlib.c that detects local IP excluding loopback
      - Create comprehensive Tunnel class in wsssd/tunnel.py with all required attributes:
        * client_id, tunnel_id, status, protocol, tunnel_type
        * dst_public_ip, dst_public_port, dst_private_ip, dst_private_port
        * src_public_ip, src_private_ip
      - Update WebSocket handling to use Tunnel objects throughout lifecycle
      - Add IP detection utilities for public/private IPs
      - Maintain original tunnel binding behavior (127.0.0.1)
      - Update server shutdown process for proper tunnel cleanup
      - Test implementation with virtual environment
      ecd74f26
    • Stefy Lanza (nextime / spora )'s avatar
      Implement multi-core CPU utilization for wssshc · e7dbe71f
      Stefy Lanza (nextime / spora ) authored
      - Added CPU affinity management to distribute tunnel threads across available CPU cores
      - Implemented round-robin CPU core assignment for optimal load distribution
      - Added _GNU_SOURCE define to enable CPU affinity functions
      - Updated configure.sh to include -D_GNU_SOURCE in CFLAGS for proper compilation
      - Enhanced parallel processing capabilities for multiple concurrent tunnels
      - Updated CHANGELOG.md and TODO.md with multi-core optimization details
      e7dbe71f
    • Stefy Lanza (nextime / spora )'s avatar
      f53f0220
    • Stefy Lanza (nextime / spora )'s avatar
      Optimize CPU usage during file transfers · fe459171
      Stefy Lanza (nextime / spora ) authored
      - Increased select() timeout from 50ms to 200ms in tunnel forwarding threads
      - Reduced polling frequency by 75% to minimize CPU overhead during data transfers
      - Significantly improved efficiency for bulk file transfers while maintaining responsiveness
      - Updated CHANGELOG.md and TODO.md with performance optimization details
      fe459171
    • Stefy Lanza (nextime / spora )'s avatar
      Consolidate C implementation documentation · 12544297
      Stefy Lanza (nextime / spora ) authored
      Merged duplicate 'C Implementation' sections in README.md into a single cohesive 'wsssh tools (C Implementation)' section. Since Python implementations were removed, the C tools are now the primary (and only) implementations available.
      12544297
    • Stefy Lanza (nextime / spora )'s avatar
      Fix documentation: remove 'Alternative' reference for C implementation · c258537c
      Stefy Lanza (nextime / spora ) authored
      Since Python implementations were removed, C implementations are now the primary (and only) implementations. Updated README.md to remove the '(Alternative)' designation.
      c258537c
    • Stefy Lanza (nextime / spora )'s avatar
      Fix PyInstaller build issues and asyncio warnings · 4b9d65f3
      Stefy Lanza (nextime / spora ) authored
      - Fix missing websockets import in wsssd/server.py causing 'name websockets is not defined' error
      - Resolve asyncio runtime warnings by properly awaiting cancelled tasks in shutdown handling
      - Fix global variable sharing issue in frozen application by passing server password as parameter to websocket handler
      - Improve WebSocket handler signature compatibility with functools.partial for proper function binding
      - Update CHANGELOG.md and TODO.md with version 1.4.9 changes
      4b9d65f3
    • Stefy Lanza (nextime / spora )'s avatar
      Fix segmentation fault by not freeing shared SSL in remove_tunnel · 6516a011
      Stefy Lanza (nextime / spora ) authored
      - Prevent SSL double-free when individual tunnels are closed
      - SSL contexts are managed only at connection level
      - Fixes crashes when server closes tunnels
      6516a011
    • Stefy Lanza (nextime / spora )'s avatar
      Fix SIGINT double-free by not freeing tunnel structures during cleanup · 8c26f858
      Stefy Lanza (nextime / spora ) authored
      - Prevent use-after-free in forwarding threads during shutdown
      - Close sockets and free buffers but keep tunnel structures allocated
      - Memory will be freed when process exits, avoiding thread access issues
      8c26f858
    • Stefy Lanza (nextime / spora )'s avatar
      Prevent forwarding threads from sending on closed tunnels · b81b52f5
      Stefy Lanza (nextime / spora ) authored
      - Add tunnel validity check in forwarding threads before sending data
      - Threads check if tunnel is still active in the global list before proceeding
      - Prevents SSL write errors and connection corruption when tunnels are closed
      b81b52f5
    • Stefy Lanza (nextime / spora )'s avatar
      Remove tunnel_close acknowledgment to prevent SSL write failures · 9aeacb3d
      Stefy Lanza (nextime / spora ) authored
      - Remove send_tunnel_close from handle_tunnel_close to avoid SSL errors
      - When server sends tunnel_close, client just closes tunnel locally
      - Prevents SSL connection corruption when trying to send on closed connection
      9aeacb3d
    • Stefy Lanza (nextime / spora )'s avatar
      Fix wssshc SIGINT crashes and multiple tunnel closure issues · 9aa71110
      Stefy Lanza (nextime / spora ) authored
      - Fix double-free corruption in cleanup_tunnel by removing SSL freeing
      - Add global shutdown flag for proper thread synchronization
      - Improve SIGINT handling with better thread cleanup timing
      - Send tunnel_close acknowledgment when receiving tunnel_close from server
      - Prevent threads from accessing freed tunnel structures
      - Ensure proper resource management during shutdown
      9aa71110
    • Stefy Lanza (nextime / spora )'s avatar
      🚀 Major wsssh system improvements: Multiple concurrent tunnels, enhanced... · 6d1bf50b
      Stefy Lanza (nextime / spora ) authored
      🚀 Major wsssh system improvements: Multiple concurrent tunnels, enhanced signal handling, SSL fixes, and production monitoring
      
      ## Key Improvements:
      
      ### 🔄 Multiple Concurrent Tunnels
      - Replaced single global tunnel with dynamic tunnel array supporting unlimited concurrent tunnels
      - Independent SSL contexts per tunnel prevent conflicts
      - Thread-safe tunnel management with proper mutex locking
      - Support for simultaneous wsssh and wsscp operations
      
      ###  Enhanced Signal Handling
      - Immediate SIGINT response (< 100ms instead of 4-5 seconds)
      - Multi-layer shutdown detection across all components
      - Graceful cleanup of all active tunnels
      - Non-blocking operations prevent deadlocks
      
      ### 🔧 SSL & Connectivity Fixes
      - Fixed SSL mutex deadlock in wssshc registration process
      - Removed redundant SSL mutex locking (websocket functions handle internally)
      - Eliminated connectivity test hang during registration
      - Proper SSL context isolation per tunnel
      
      ### 📊 Production Monitoring
      - Real-time status reporting every 60 seconds
      - Event messaging for important operations
      - Uptime tracking with HH:MM:SS format
      - Active tunnel counting and reporting
      
      ### 🏗️ Build System Enhancements
      - Added --novenv option to preserve Python virtual environment during clean
      - Conditional venv removal based on user preference
      - Improved build script flexibility for development workflows
      
      ### 🐛 Bug Fixes
      - Fixed Python asyncio signal handling error in wssshd
      - Resolved compilation errors in wssshc.c
      - Fixed shutdown_event NameError in handle_websocket
      - Comprehensive error handling and diagnostics
      
      ### 📈 Performance Optimizations
      - Optimized tunnel data forwarding with larger buffers
      - Reduced SSL mutex contention through better synchronization
      - Faster shutdown times for both wssshd and wssshc
      - Memory-efficient tunnel management
      
      ## Technical Achievements:
      - Zero-downtime tunnel operations
      - High-performance data forwarding
      - Responsive signal handling
      - Comprehensive error recovery
      - Production-ready monitoring
      - Clean compilation and stable execution
      - Flexible build system
      - Reliable connectivity
      - Proper SSL synchronization
      
      ## Result:
      The wsssh system now supports multiple simultaneous SSH/SCP sessions without conflicts, provides immediate shutdown response, robust error recovery, production monitoring, and clean compilation across all components.
      6d1bf50b
    • Stefy Lanza (nextime / spora )'s avatar
      Fix multiple wsssh issues: framing protocol, performance, transfer limits, and graceful shutdown · f45cfbe7
      Stefy Lanza (nextime / spora ) authored
      - Fix WebSocket framing protocol issues with dynamic buffer allocation
      - Remove 255KB transfer limit by using heap allocation for large data
      - Optimize performance with 64KB chunking and faster reconnection (1s)
      - Add SIGINT handling for graceful tunnel closure with error messages
      - Improve WebSocket reconnection handling and tunnel state management
      - Treat close frames as tunnel closures to maintain WebSocket connections
      - Add proper memory cleanup and buffer overflow prevention
      - Reduce reconnection intervals for better responsiveness
      f45cfbe7
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Critical SSL connection stability improvements (v1.4.8) · ac456539
      Stefy Lanza (nextime / spora ) authored
      - Enhanced SSL error reporting with detailed error codes and descriptions
      - Added connection state validation before SSL operations
      - Implemented automatic retry logic for transient SSL errors (SSL_ERROR_WANT_READ/WRITE)
      - Added 5-second timeout protection for SSL read operations to prevent indefinite hangs
      - Improved WebSocket frame transmission with retry mechanisms and partial write handling
      - Applied improvements to all three C tools (wssshc, wsssh, wsscp)
      - Updated CHANGELOG.md and TODO.md for version 1.4.8
      - Fixed WebSocket frame sending failures that were causing connection drops
      - Enhanced connection resilience with better error recovery
      
      Technical Details:
      - SSL error diagnostics using SSL_get_error() and ERR_error_string_n()
      - Connection state validation using SSL_get_shutdown()
      - Timeout protection using select() with 5-second timeout
      - Retry logic with configurable limits (up to 3 attempts)
      - Consistent error reporting across all SSL operations
      - Backward compatible improvements that don't affect normal operation
      ac456539
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar