# WHP Terminal WebSocket Proxy Configuration
# Place this file in /etc/httpd/conf.d/

# Load required modules
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_http_module modules/mod_proxy_http.so

# WebSocket proxy for terminal
ProxyPass /terminal-ws ws://localhost:8090/
ProxyPassReverse /terminal-ws ws://localhost:8090/

# Allow WebSocket upgrades
<Location /terminal-ws>
    ProxyPreserveHost On
    ProxyPassReverse /
    
    # Allow access without authentication for WebSocket upgrade
    # Authentication is handled by the Node.js terminal server
    Satisfy Any
    Require all granted
    
    # Security headers
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Content-Type-Options "nosniff"
</Location>