diff --git a/backend/app.py b/backend/app.py index ea1c0ab..bee4060 100644 --- a/backend/app.py +++ b/backend/app.py @@ -22,6 +22,8 @@ app = Flask(__name__) CORS(app, resources={r"/*": {"origins": "*"}}) # Initialize SocketIO +# Note: Frontend uses polling-only transport due to Cloudflare/reverse proxy +# blocking WebSocket connections. Server supports both transports. socketio = SocketIO( app, cors_allowed_origins="*", diff --git a/frontend/lib/hooks/useInteractiveTerminal.ts b/frontend/lib/hooks/useInteractiveTerminal.ts index 1b599b9..b8cc5ac 100644 --- a/frontend/lib/hooks/useInteractiveTerminal.ts +++ b/frontend/lib/hooks/useInteractiveTerminal.ts @@ -114,9 +114,10 @@ export function useInteractiveTerminal({ (window as any)._debugTerminal = term; } - const wsUrl = API_BASE_URL.replace(/^http/, 'ws'); - socket = io(`${wsUrl}/terminal`, { - transports: ['polling', 'websocket'], + // Use polling only - WebSocket is blocked by Cloudflare/reverse proxy + // This prevents "Invalid frame header" errors during upgrade attempts + socket = io(`${API_BASE_URL}/terminal`, { + transports: ['polling'], reconnectionDelayMax: 10000, timeout: 60000, forceNew: true,